Skip to content

Commit

Permalink
fix: remove r16 models and fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
andy89923 committed Jul 30, 2024
1 parent 61395f3 commit d94a13f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 97 deletions.
20 changes: 0 additions & 20 deletions models/model_authentication_info_result.go

This file was deleted.

20 changes: 0 additions & 20 deletions models/model_created_ee_subscription.go

This file was deleted.

26 changes: 0 additions & 26 deletions models/model_monitoring_report.go

This file was deleted.

3 changes: 3 additions & 0 deletions models/model_nrf_access_token_access_token_claims.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package models

import "github.com/golang-jwt/jwt"

// The claims data structure for the access token
type NrfAccessTokenAccessTokenClaims struct {
// String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4, as described in IETF RFC 4122.
Expand All @@ -33,4 +35,5 @@ type NrfAccessTokenAccessTokenClaims struct {
ProducerNfServiceSetId string `json:"producerNfServiceSetId,omitempty" yaml:"producerNfServiceSetId" bson:"producerNfServiceSetId,omitempty"`
// String uniquely identifying a NF instance. The format of the NF Instance ID shall be a Universally Unique Identifier (UUID) version 4, as described in IETF RFC 4122.
SourceNfInstanceId string `json:"sourceNfInstanceId,omitempty" yaml:"sourceNfInstanceId" bson:"sourceNfInstanceId,omitempty"`
jwt.StandardClaims
}
22 changes: 0 additions & 22 deletions models/model_reachability_for_sms_report.go

This file was deleted.

12 changes: 5 additions & 7 deletions models/model_sip_authentication_info_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@

package models



type SipAuthenticationInfoResult struct {
Impi string `json:"impi" yaml:"impi" bson:"impi"`
Var3gAkaAvs []*Model3GAkaAv `json:"3gAkaAvs,omitempty" yaml:"3gAkaAvs" bson:"3gAkaAvs"`
DigestAuth *DigestAuthentication `json:"digestAuth,omitempty" yaml:"digestAuth" bson:"digestAuth"`
LineIdentifierList []string `json:"lineIdentifierList,omitempty" yaml:"lineIdentifierList" bson:"lineIdentifierList"`
IpAddress *IpAddress `json:"ipAddress,omitempty" yaml:"ipAddress" bson:"ipAddress"`
Impi string `json:"impi" yaml:"impi" bson:"impi"`
Var3gAkaAvs []*Model3GAkaAv `json:"3gAkaAvs,omitempty" yaml:"3gAkaAvs" bson:"3gAkaAvs"`
DigestAuth *DigestAuthentication `json:"digestAuth,omitempty" yaml:"digestAuth" bson:"digestAuth"`
LineIdentifierList []string `json:"lineIdentifierList,omitempty" yaml:"lineIdentifierList" bson:"lineIdentifierList"`
IpAddress *IpAddr `json:"ipAddress,omitempty" yaml:"ipAddress" bson:"ipAddress"`
}
4 changes: 2 additions & 2 deletions oauth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func VerifyOAuth(
access_token := auth_fields[1]
token, err := jwt.ParseWithClaims(
access_token,
&models.AccessTokenClaims{},
&models.NrfAccessTokenAccessTokenClaims{},
func(token *jwt.Token) (interface{}, error) {
if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok {
return nil, errors.Wrapf(err, "Unexpected signing method")
Expand All @@ -84,7 +84,7 @@ func VerifyOAuth(
return errors.Wrapf(err, "verify OAuth parse")
}

if !verifyScope(token.Claims.(*models.AccessTokenClaims).Scope, serviceName) {
if !verifyScope(token.Claims.(*models.NrfAccessTokenAccessTokenClaims).Scope, serviceName) {
return errors.Wrapf(err, "verify OAuth scope")
}
return nil
Expand Down

0 comments on commit d94a13f

Please sign in to comment.