From c50d24d4b94509dc777ab8319feb066f6e277103 Mon Sep 17 00:00:00 2001 From: Max Korp Date: Mon, 3 Dec 2018 09:33:52 -0700 Subject: [PATCH] Add changes for auth refresh --- apis/management.cattle.io/v3/authn_types.go | 3 +++ user/manager.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apis/management.cattle.io/v3/authn_types.go b/apis/management.cattle.io/v3/authn_types.go index e5d2ef55..c1a4ce50 100644 --- a/apis/management.cattle.io/v3/authn_types.go +++ b/apis/management.cattle.io/v3/authn_types.go @@ -25,6 +25,7 @@ type Token struct { Expired bool `json:"expired"` ExpiresAt string `json:"expiresAt"` Current bool `json:"current"` + Enabled *bool `json:"enabled,omitempty" norman:"default=true"` } type User struct { @@ -71,6 +72,8 @@ type UserAttribute struct { UserName string GroupPrincipals map[string]Principals // the value is a []Principal, but code generator cannot handle slice as a value + LastRefresh string + NeedsRefresh bool } type Principals struct { diff --git a/user/manager.go b/user/manager.go index 2e43fc60..989863c1 100644 --- a/user/manager.go +++ b/user/manager.go @@ -11,7 +11,7 @@ type Manager interface { GetUser(apiContext *types.APIContext) string EnsureToken(tokenName, description, userName string) (string, error) EnsureUser(principalName, displayName string) (*v3.User, error) - CheckAccess(accessMode string, allowedPrincipalIDs []string, user v3.Principal, groups []v3.Principal) (bool, error) + CheckAccess(accessMode string, allowedPrincipalIDs []string, userPrincipalID string, groups []v3.Principal) (bool, error) SetPrincipalOnCurrentUserByUserID(userID string, principal v3.Principal) (*v3.User, error) CreateNewUserClusterRoleBinding(userName string, userUID apitypes.UID) error }