Revert "Update Kubernetes storage backend"

This reverts commit 228bdc324877bf67ecdd434503b9c1b25d8e7d28.
This commit is contained in:
Joel Speed 2019-04-18 15:18:50 +01:00
parent 236b25b68e
commit 45a40a13a3
No known key found for this signature in database
GPG Key ID: 6E80578D6751DEFB

View File

@ -265,7 +265,8 @@ type AuthRequest struct {
// with a backend. // with a backend.
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"`
} }
@ -289,6 +290,7 @@ 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),
} }
@ -314,6 +316,7 @@ 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),
} }
@ -408,26 +411,28 @@ func (cli *client) fromStorageAuthCode(a storage.AuthCode) AuthCode {
Name: a.ID, Name: a.ID,
Namespace: cli.namespace, Namespace: cli.namespace,
}, },
ClientID: a.ClientID, ClientID: a.ClientID,
RedirectURI: a.RedirectURI, RedirectURI: a.RedirectURI,
ConnectorID: a.ConnectorID, ConnectorID: a.ConnectorID,
Nonce: a.Nonce, ConnectorData: a.ConnectorData,
Scopes: a.Scopes, Nonce: a.Nonce,
Claims: fromStorageClaims(a.Claims), Scopes: a.Scopes,
Expiry: a.Expiry, Claims: fromStorageClaims(a.Claims),
Expiry: a.Expiry,
} }
} }
func toStorageAuthCode(a AuthCode) storage.AuthCode { func toStorageAuthCode(a AuthCode) storage.AuthCode {
return storage.AuthCode{ return storage.AuthCode{
ID: a.ObjectMeta.Name, ID: a.ObjectMeta.Name,
ClientID: a.ClientID, ClientID: a.ClientID,
RedirectURI: a.RedirectURI, RedirectURI: a.RedirectURI,
ConnectorID: a.ConnectorID, ConnectorID: a.ConnectorID,
Nonce: a.Nonce, ConnectorData: a.ConnectorData,
Scopes: a.Scopes, Nonce: a.Nonce,
Claims: toStorageClaims(a.Claims), Scopes: a.Scopes,
Expiry: a.Expiry, Claims: toStorageClaims(a.Claims),
Expiry: a.Expiry,
} }
} }
@ -461,15 +466,16 @@ type RefreshList struct {
func toStorageRefreshToken(r RefreshToken) storage.RefreshToken { func toStorageRefreshToken(r RefreshToken) storage.RefreshToken {
return storage.RefreshToken{ return storage.RefreshToken{
ID: r.ObjectMeta.Name, ID: r.ObjectMeta.Name,
Token: r.Token, Token: r.Token,
CreatedAt: r.CreatedAt, CreatedAt: r.CreatedAt,
LastUsed: r.LastUsed, LastUsed: r.LastUsed,
ClientID: r.ClientID, ClientID: r.ClientID,
ConnectorID: r.ConnectorID, ConnectorID: r.ConnectorID,
Scopes: r.Scopes, ConnectorData: r.ConnectorData,
Nonce: r.Nonce, Scopes: r.Scopes,
Claims: toStorageClaims(r.Claims), Nonce: r.Nonce,
Claims: toStorageClaims(r.Claims),
} }
} }
@ -483,14 +489,15 @@ func (cli *client) fromStorageRefreshToken(r storage.RefreshToken) RefreshToken
Name: r.ID, Name: r.ID,
Namespace: cli.namespace, Namespace: cli.namespace,
}, },
Token: r.Token, Token: r.Token,
CreatedAt: r.CreatedAt, CreatedAt: r.CreatedAt,
LastUsed: r.LastUsed, LastUsed: r.LastUsed,
ClientID: r.ClientID, ClientID: r.ClientID,
ConnectorID: r.ConnectorID, ConnectorID: r.ConnectorID,
Scopes: r.Scopes, ConnectorData: r.ConnectorData,
Nonce: r.Nonce, Scopes: r.Scopes,
Claims: fromStorageClaims(r.Claims), Nonce: r.Nonce,
Claims: fromStorageClaims(r.Claims),
} }
} }