Skip to content

Commit

Permalink
fix: confict & golangci error
Browse files Browse the repository at this point in the history
  • Loading branch information
KunLee76 committed Aug 21, 2024
1 parent 2524f64 commit c32b615
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/mitchellh/mapstructure v1.4.2
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.3
github.com/stretchr/testify v1.8.4
github.com/urfave/cli v1.22.5
go.mongodb.org/mongo-driver v1.8.4
gopkg.in/yaml.v2 v2.4.0
Expand Down
14 changes: 7 additions & 7 deletions internal/sbi/processor/access_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (p *Processor) AccessTokenProcedure(request models.NrfAccessTokenAccessToke
)
scope := request.Scope
now := time.Now()
nowNum := int32(now.Unix())
// nowNum := int32(now.Unix())

errResponse := p.AccessTokenScopeCheck(request)
if errResponse != nil {
Expand All @@ -64,15 +64,15 @@ func (p *Processor) AccessTokenProcedure(request models.NrfAccessTokenAccessToke
// Create AccessToken
nrfCtx := nrf_context.GetSelf()
accessTokenClaims := models.AccessTokenClaims{
Iss: nrfCtx.Nrf_NfInstanceID, // NF instance id of the NRF
Sub: request.NfInstanceId, // nfInstanceId of service consumer
Aud: request.TargetNfInstanceId, // nfInstanceId of service producer
Scope: request.Scope, // TODO: the name of the NF services for which the
Exp: now + expiration, // access_token is authorized for use
Iss: nrfCtx.Nrf_NfInstanceID, // NF instance id of the NRF
Sub: request.NfInstanceId, // nfInstanceId of service consumer
Aud: request.TargetNfInstanceId, // nfInstanceId of service producer
Scope: request.Scope, // TODO: the name of the NF services for which the
Exp: int32(now.Unix()) + expiration, // access_token is authorized for use
RegisteredClaims: jwt.RegisteredClaims{},
}

accessTokenClaims.IssuedAt = &jwt.NumericDate{Time: time.Unix(int64(now), 0)}
accessTokenClaims.IssuedAt = jwt.NewNumericDate(now)

// Use NRF private key to sign AccessToken
token := jwt.NewWithClaims(jwt.GetSigningMethod("RS512"), accessTokenClaims)
Expand Down

0 comments on commit c32b615

Please sign in to comment.