Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
avatus committed Jun 4, 2024
1 parent 004e95b commit 7edfe8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/auth/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func NewTestAuthServer(cfg TestAuthServerConfig) (*TestAuthServer, error) {
return nil, trace.Wrap(err)
}

token, err := types.NewProvisionTokenFromSpec("static-token", time.Time{}, types.ProvisionTokenSpecV2{
token, err := types.NewProvisionTokenFromSpec("static-token", time.Unix(0, 0).UTC(), types.ProvisionTokenSpecV2{
Roles: types.SystemRoles{types.RoleNode},
})
if err != nil {
Expand Down
9 changes: 5 additions & 4 deletions lib/web/join_tokens_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func Test_getTokens(t *testing.T) {
Id: "static-token",
SafeName: "************",
Roles: types.SystemRoles{types.RoleNode},
Expiry: time.Unix(0, 0).UTC(),
IsStatic: true,
Method: types.JoinMethodToken,
}
Expand Down Expand Up @@ -163,7 +164,7 @@ func Test_getTokens(t *testing.T) {
Id: "test-token",
SafeName: "**********",
IsStatic: false,
Expires: expiry,
Expiry: expiry,
Roles: types.SystemRoles{
types.RoleNode,
},
Expand All @@ -173,7 +174,7 @@ func Test_getTokens(t *testing.T) {
Id: "test-token-2",
SafeName: "************",
IsStatic: false,
Expires: expiry,
Expiry: expiry,
Roles: types.SystemRoles{
types.RoleNode,
types.RoleDatabase,
Expand All @@ -184,7 +185,7 @@ func Test_getTokens(t *testing.T) {
Id: "test-token-3-and-super-duper-long",
SafeName: "************************uper-long",
IsStatic: false,
Expires: expiry,
Expiry: expiry,
Roles: types.SystemRoles{
types.RoleNode,
types.RoleKube,
Expand Down Expand Up @@ -225,7 +226,7 @@ func Test_getTokens(t *testing.T) {
Id: userToken.GetName(),
SafeName: userToken.GetSafeName(),
IsStatic: false,
Expires: userToken.Expiry(),
Expiry: userToken.Expiry(),
Roles: userToken.GetRoles(),
Method: types.JoinMethodToken,
}
Expand Down

0 comments on commit 7edfe8f

Please sign in to comment.