diff --git a/e b/e index 22406e97f4bb3..fe2c2aab31025 160000 --- a/e +++ b/e @@ -1 +1 @@ -Subproject commit 22406e97f4bb3ba9bc55ba4ef279058beff27f20 +Subproject commit fe2c2aab31025994ea62b8d83ec6545806af45e9 diff --git a/lib/defaults/defaults.go b/lib/defaults/defaults.go index 93a69bb37fb6b..ce566d1549ace 100644 --- a/lib/defaults/defaults.go +++ b/lib/defaults/defaults.go @@ -261,6 +261,9 @@ const ( // InactivityFlushPeriod is a period of inactivity // that triggers upload of the data - flush. InactivityFlushPeriod = 5 * time.Minute + + // NodeJoinTokenTTL is when a token for nodes expires. + NodeJoinTokenTTL = 4 * time.Hour ) var ( diff --git a/lib/web/ui/usercontext.go b/lib/web/ui/usercontext.go index d75a73ff60fbd..7c7792b87d06e 100644 --- a/lib/web/ui/usercontext.go +++ b/lib/web/ui/usercontext.go @@ -43,6 +43,10 @@ type userACL struct { TrustedClusters access `json:"trustedClusters"` // Events defines access to audit logs Events access `json:"events"` + // Tokens defines access to tokens. + Tokens access `json:"tokens"` + // Nodes defines access to nodes. + Nodes access `json:"nodes"` // SSH defines access to servers SSHLogins []string `json:"sshLogins"` } @@ -118,6 +122,8 @@ func NewUserContext(user services.User, userRoles services.RoleSet) (*UserContex trustedClusterAccess := newAccess(userRoles, ctx, services.KindTrustedCluster) eventAccess := newAccess(userRoles, ctx, services.KindEvent) userAccess := newAccess(userRoles, ctx, services.KindUser) + tokenAccess := newAccess(userRoles, ctx, services.KindToken) + nodeAccess := newAccess(userRoles, ctx, services.KindNode) logins := getLogins(userRoles) acl := userACL{ @@ -128,6 +134,8 @@ func NewUserContext(user services.User, userRoles services.RoleSet) (*UserContex Events: eventAccess, SSHLogins: logins, Users: userAccess, + Tokens: tokenAccess, + Nodes: nodeAccess, } // local user diff --git a/lib/web/ui/usercontext_test.go b/lib/web/ui/usercontext_test.go index 38f5a6d6ea4d1..1193f9c46abce 100644 --- a/lib/web/ui/usercontext_test.go +++ b/lib/web/ui/usercontext_test.go @@ -68,6 +68,8 @@ func (s *UserContextSuite) TestNewUserContext(c *check.C) { c.Assert(userContext.ACL.Sessions, check.DeepEquals, denied) c.Assert(userContext.ACL.Roles, check.DeepEquals, denied) c.Assert(userContext.ACL.Users, check.DeepEquals, denied) + c.Assert(userContext.ACL.Tokens, check.DeepEquals, denied) + c.Assert(userContext.ACL.Nodes, check.DeepEquals, denied) c.Assert(userContext.ACL.SSHLogins, check.DeepEquals, []string{"a", "b", "d"}) // test local auth type