Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vapopov committed Aug 27, 2024
1 parent 12e1b79 commit b3a62d7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions lib/auth/autoupdate/v1/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,24 @@ func TestServiceAccess(t *testing.T) {
allowedStates []authz.AdminActionAuthState
disallowedStates []authz.AdminActionAuthState
}{
{
name: "CreateAutoupdateConfig",
allowedStates: []authz.AdminActionAuthState{
authz.AdminActionAuthNotRequired,
authz.AdminActionAuthMFAVerified,
authz.AdminActionAuthMFAVerifiedWithReuse,
},
allowedVerbs: []string{types.VerbCreate},
},
{
name: "UpdateAutoupdateConfig",
allowedStates: []authz.AdminActionAuthState{
authz.AdminActionAuthNotRequired,
authz.AdminActionAuthMFAVerified,
authz.AdminActionAuthMFAVerifiedWithReuse,
},
allowedVerbs: []string{types.VerbUpdate},
},
{
name: "UpsertAutoupdateConfig",
allowedStates: []authz.AdminActionAuthState{
Expand All @@ -103,6 +121,24 @@ func TestServiceAccess(t *testing.T) {
allowedVerbs: []string{types.VerbDelete},
},
// Autoupdate version check.
{
name: "CreateAutoupdateVersion",
allowedStates: []authz.AdminActionAuthState{
authz.AdminActionAuthNotRequired,
authz.AdminActionAuthMFAVerified,
authz.AdminActionAuthMFAVerifiedWithReuse,
},
allowedVerbs: []string{types.VerbCreate},
},
{
name: "UpdateAutoupdateVersion",
allowedStates: []authz.AdminActionAuthState{
authz.AdminActionAuthNotRequired,
authz.AdminActionAuthMFAVerified,
authz.AdminActionAuthMFAVerifiedWithReuse,
},
allowedVerbs: []string{types.VerbUpdate},
},
{
name: "UpsertAutoupdateVersion",
allowedStates: []authz.AdminActionAuthState{
Expand Down
1 change: 1 addition & 0 deletions lib/services/autoupdates.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package services

import (
"context"

"github.com/gravitational/teleport/api/gen/proto/go/teleport/autoupdate/v1"
)

Expand Down

0 comments on commit b3a62d7

Please sign in to comment.