Update Kubernetes storage backend

This commit is contained in:
Joel Speed 2018-01-29 21:15:01 +00:00
parent c54f1656c7
commit 7a76c767fe
No known key found for this signature in database
GPG Key ID: 6E80578D6751DEFB

View File

@ -266,7 +266,6 @@ type AuthRequest struct {
Claims Claims `json:"claims,omitempty"` Claims Claims `json:"claims,omitempty"`
// The connector used to login the user. Set when the user authenticates. // The connector used to login the user. Set when the user authenticates.
ConnectorID string `json:"connectorID,omitempty"` ConnectorID string `json:"connectorID,omitempty"`
ConnectorData []byte `json:"connectorData,omitempty"`
Expiry time.Time `json:"expiry"` Expiry time.Time `json:"expiry"`
} }
@ -290,7 +289,6 @@ func toStorageAuthRequest(req AuthRequest) storage.AuthRequest {
ForceApprovalPrompt: req.ForceApprovalPrompt, ForceApprovalPrompt: req.ForceApprovalPrompt,
LoggedIn: req.LoggedIn, LoggedIn: req.LoggedIn,
ConnectorID: req.ConnectorID, ConnectorID: req.ConnectorID,
ConnectorData: req.ConnectorData,
Expiry: req.Expiry, Expiry: req.Expiry,
Claims: toStorageClaims(req.Claims), Claims: toStorageClaims(req.Claims),
} }
@ -316,7 +314,6 @@ func (cli *client) fromStorageAuthRequest(a storage.AuthRequest) AuthRequest {
LoggedIn: a.LoggedIn, LoggedIn: a.LoggedIn,
ForceApprovalPrompt: a.ForceApprovalPrompt, ForceApprovalPrompt: a.ForceApprovalPrompt,
ConnectorID: a.ConnectorID, ConnectorID: a.ConnectorID,
ConnectorData: a.ConnectorData,
Expiry: a.Expiry, Expiry: a.Expiry,
Claims: fromStorageClaims(a.Claims), Claims: fromStorageClaims(a.Claims),
} }
@ -414,7 +411,6 @@ func (cli *client) fromStorageAuthCode(a storage.AuthCode) AuthCode {
ClientID: a.ClientID, ClientID: a.ClientID,
RedirectURI: a.RedirectURI, RedirectURI: a.RedirectURI,
ConnectorID: a.ConnectorID, ConnectorID: a.ConnectorID,
ConnectorData: a.ConnectorData,
Nonce: a.Nonce, Nonce: a.Nonce,
Scopes: a.Scopes, Scopes: a.Scopes,
Claims: fromStorageClaims(a.Claims), Claims: fromStorageClaims(a.Claims),
@ -428,7 +424,6 @@ func toStorageAuthCode(a AuthCode) storage.AuthCode {
ClientID: a.ClientID, ClientID: a.ClientID,
RedirectURI: a.RedirectURI, RedirectURI: a.RedirectURI,
ConnectorID: a.ConnectorID, ConnectorID: a.ConnectorID,
ConnectorData: a.ConnectorData,
Nonce: a.Nonce, Nonce: a.Nonce,
Scopes: a.Scopes, Scopes: a.Scopes,
Claims: toStorageClaims(a.Claims), Claims: toStorageClaims(a.Claims),
@ -472,7 +467,6 @@ func toStorageRefreshToken(r RefreshToken) storage.RefreshToken {
LastUsed: r.LastUsed, LastUsed: r.LastUsed,
ClientID: r.ClientID, ClientID: r.ClientID,
ConnectorID: r.ConnectorID, ConnectorID: r.ConnectorID,
ConnectorData: r.ConnectorData,
Scopes: r.Scopes, Scopes: r.Scopes,
Nonce: r.Nonce, Nonce: r.Nonce,
Claims: toStorageClaims(r.Claims), Claims: toStorageClaims(r.Claims),
@ -494,7 +488,6 @@ func (cli *client) fromStorageRefreshToken(r storage.RefreshToken) RefreshToken
LastUsed: r.LastUsed, LastUsed: r.LastUsed,
ClientID: r.ClientID, ClientID: r.ClientID,
ConnectorID: r.ConnectorID, ConnectorID: r.ConnectorID,
ConnectorData: r.ConnectorData,
Scopes: r.Scopes, Scopes: r.Scopes,
Nonce: r.Nonce, Nonce: r.Nonce,
Claims: fromStorageClaims(r.Claims), Claims: fromStorageClaims(r.Claims),
@ -555,6 +548,7 @@ type OfflineSessions struct {
UserID string `json:"userID,omitempty"` UserID string `json:"userID,omitempty"`
ConnID string `json:"connID,omitempty"` ConnID string `json:"connID,omitempty"`
Refresh map[string]*storage.RefreshTokenRef `json:"refresh,omitempty"` Refresh map[string]*storage.RefreshTokenRef `json:"refresh,omitempty"`
ConnectorData []byte `json:"connectorData,omitempty"`
} }
func (cli *client) fromStorageOfflineSessions(o storage.OfflineSessions) OfflineSessions { func (cli *client) fromStorageOfflineSessions(o storage.OfflineSessions) OfflineSessions {
@ -570,6 +564,7 @@ func (cli *client) fromStorageOfflineSessions(o storage.OfflineSessions) Offline
UserID: o.UserID, UserID: o.UserID,
ConnID: o.ConnID, ConnID: o.ConnID,
Refresh: o.Refresh, Refresh: o.Refresh,
ConnectorData: o.ConnectorData,
} }
} }
@ -578,6 +573,7 @@ func toStorageOfflineSessions(o OfflineSessions) storage.OfflineSessions {
UserID: o.UserID, UserID: o.UserID,
ConnID: o.ConnID, ConnID: o.ConnID,
Refresh: o.Refresh, Refresh: o.Refresh,
ConnectorData: o.ConnectorData,
} }
if s.Refresh == nil { if s.Refresh == nil {
// Server code assumes this will be non-nil. // Server code assumes this will be non-nil.