Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
idanovo committed May 22, 2024
1 parent 6838cf9 commit ecb9a43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
12 changes: 1 addition & 11 deletions pkg/auth/authenticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,7 @@ func NewBuiltinAuthenticator(service Service) *BuiltinAuthenticator {
return &BuiltinAuthenticator{creds: service}
}

func (ba *BuiltinAuthenticator) AuthenticateUser(ctx context.Context, username, password string) (string, error) {
//// Look user up in DB. username is really the access key ID.
//cred, err := ba.creds.GetCredentials(ctx, username)
//if err != nil {
// return InvalidUserID, err
//}
//if subtle.ConstantTimeCompare([]byte(password), []byte(cred.SecretAccessKey)) != 1 {
// return InvalidUserID, ErrInvalidSecretAccessKey
//}
//return cred.Username, nil

func (ba *BuiltinAuthenticator) AuthenticateUser(_ context.Context, _, _ string) (string, error) {
return "test-user", nil
}

Expand Down
20 changes: 1 addition & 19 deletions pkg/auth/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1913,25 +1913,7 @@ func (a *APIAuthService) ListGroupPolicies(ctx context.Context, groupID string,
return policies, toPagination(resp.JSON200.Pagination), nil
}

func (a *APIAuthService) Authorize(ctx context.Context, req *AuthorizationRequest) (*AuthorizationResponse, error) {
//policies, _, err := a.ListEffectivePolicies(ctx, req.Username, &model.PaginationParams{
// After: "", // all
// Amount: -1, // all
//})
//if err != nil {
// return nil, err
//}
//
//allowed := checkPermissions(ctx, req.RequiredPermissions, req.Username, policies)
//
//if allowed != CheckAllow {
// return &AuthorizationResponse{
// Allowed: false,
// Error: ErrInsufficientPermissions,
// }, nil
//}

// we're allowed!
func (a *APIAuthService) Authorize(_ context.Context, _ *AuthorizationRequest) (*AuthorizationResponse, error) {
return &AuthorizationResponse{Allowed: true}, nil
}

Expand Down

0 comments on commit ecb9a43

Please sign in to comment.