Added support for *stir_initiate

This commit is contained in:
Trial97
2020-04-16 17:25:51 +03:00
committed by Dan Christian Bogos
parent 0fadf12a51
commit 3e8d18281f
11 changed files with 106 additions and 21 deletions

View File

@@ -669,7 +669,8 @@ const (
MetaRelease = "*release"
MetaAllocate = "*allocate"
MetaAuthorize = "*authorize"
MetaSTIRAuthorize = "*stir_authorize"
MetaSTIRAuthenticate = "*stir_authenticate"
MetaSTIRInitiate = "*stir_initiate"
MetaInit = "*init"
MetaRatingPlanCost = "*rating_plan_cost"
RatingPlanIDs = "RatingPlanIDs"
@@ -1985,6 +1986,8 @@ const (
STIROriginatorURI = "STIROriginatorURI"
STIRDestinationTn = "STIRDestinationTn"
STIRDestinationURI = "STIRDestinationURI"
STIRPublicKeyPath = "STIRPublicKeyPath"
STIRPrivateKeyPath = "STIRPrivateKeyPath"
STIRExtraInfoPrefix = ";info=<"
STIRExtraInfoSuffix = ">;alg=ES256;ppt=shaken"

View File

@@ -264,5 +264,5 @@ func ErrNotConvertibleTF(from, to string) error {
// NewSTIRError returns a error with a *stir_authorize prefix
func NewSTIRError(reason string) error {
return fmt.Errorf("%s: %s", MetaSTIRAuthorize, reason)
return fmt.Errorf("%s: %s", MetaSTIRAuthenticate, reason)
}

View File

@@ -239,7 +239,7 @@ func TestNewErrChargerS(t *testing.T) {
}
func TestNewSTIRError(t *testing.T) {
expected := `*stir_authorize: wrong header`
expected := `*stir_authenticate: wrong header`
if rcv := NewSTIRError("wrong header"); rcv.Error() != expected {
t.Errorf("Expecting: %q, received: %q", expected, rcv.Error())
}