Skip to content

Commit

Permalink
Merge pull request #17 from ripienaar/op_load_token
Browse files Browse the repository at this point in the history
Ensure the operator token is set during load
  • Loading branch information
aricart authored Nov 16, 2023
2 parents 8676741 + 08f5f7f commit f45d074
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion providers/nsc/nsc.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (a *NscProvider) loadOperator(si store.IStore) (*authb.OperatorData, error)
if err != nil {
return nil, err
}
od := &authb.OperatorData{BaseData: authb.BaseData{EntityName: si.GetName(), Loaded: oc.IssuedAt}, Claim: oc}
od := &authb.OperatorData{BaseData: authb.BaseData{EntityName: si.GetName(), Loaded: oc.IssuedAt, Token: string(token)}, Claim: oc}
ks := store.NewKeyStore(od.EntityName)
kp, err := ks.GetKeyPair(oc.Issuer)
if err != nil {
Expand Down
19 changes: 19 additions & 0 deletions tests/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,25 @@ func (suite *ProviderSuite) Test_OperatorSystemAccount() {
require.NoError(t, o.Accounts().Delete("SYS"))
}

func (suite *ProviderSuite) Test_MemResolver() {
t := suite.T()
auth, err := authb.NewAuth(suite.Provider)
require.NoError(t, err)

_, err = auth.Operators().Add("O")
require.NoError(t, err)

require.NoError(t, auth.Commit())

auth, err = authb.NewAuth(suite.Provider)
require.NoError(t, err)

o := auth.Operators().Get("O")

_, err = o.MemResolver()
require.NoError(t, err)
}

func (suite *ProviderSuite) Test_OperatorImport() {
t := suite.T()
auth, err := authb.NewAuth(suite.Provider)
Expand Down

0 comments on commit f45d074

Please sign in to comment.