Skip to content

Commit

Permalink
storage: Add ConnectorData to storage RefreshToken.
Browse files Browse the repository at this point in the history
  • Loading branch information
rithujohn191 committed Jan 10, 2017
1 parent 4ddc5eb commit 7c30eb6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions storage/conformance/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ func testRefreshTokenCRUD(t *testing.T, s storage.Storage) {
EmailVerified: true,
Groups: []string{"a", "b"},
},
ConnectorData: []byte(`{"some":"data"}`),
}
if err := s.CreateRefresh(refresh); err != nil {
t.Fatalf("create refresh token: %v", err)
Expand Down
24 changes: 13 additions & 11 deletions storage/kubernetes/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,12 @@ func (cli *client) CreateRefresh(r storage.RefreshToken) error {
Name: r.RefreshToken,
Namespace: cli.namespace,
},
ClientID: r.ClientID,
ConnectorID: r.ConnectorID,
Scopes: r.Scopes,
Nonce: r.Nonce,
Claims: fromStorageClaims(r.Claims),
ClientID: r.ClientID,
ConnectorID: r.ConnectorID,
Scopes: r.Scopes,
Nonce: r.Nonce,
Claims: fromStorageClaims(r.Claims),
ConnectorData: r.ConnectorData,
}
return cli.post(resourceRefreshToken, refresh)
}
Expand Down Expand Up @@ -243,12 +244,13 @@ func (cli *client) GetRefresh(id string) (storage.RefreshToken, error) {
return storage.RefreshToken{}, err
}
return storage.RefreshToken{
RefreshToken: r.ObjectMeta.Name,
ClientID: r.ClientID,
ConnectorID: r.ConnectorID,
Scopes: r.Scopes,
Nonce: r.Nonce,
Claims: toStorageClaims(r.Claims),
RefreshToken: r.ObjectMeta.Name,
ClientID: r.ClientID,
ConnectorID: r.ConnectorID,
Scopes: r.Scopes,
Nonce: r.Nonce,
Claims: toStorageClaims(r.Claims),
ConnectorData: r.ConnectorData,
}, nil
}

Expand Down
5 changes: 3 additions & 2 deletions storage/kubernetes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ type RefreshToken struct {

Nonce string `json:"nonce,omitempty"`

Claims Claims `json:"claims,omitempty"`
ConnectorID string `json:"connectorID,omitempty"`
Claims Claims `json:"claims,omitempty"`
ConnectorID string `json:"connectorID,omitempty"`
ConnectorData []byte `json:"connectorData,omitempty"`
}

// RefreshList is a list of refresh tokens.
Expand Down

0 comments on commit 7c30eb6

Please sign in to comment.