Skip to content

Commit

Permalink
Add core/v3.AuthProvider
Browse files Browse the repository at this point in the history
It's like core/v2.AuthProvider, but for core/v3

Signed-off-by: Eric Chlebek <eric@sensu.io>
  • Loading branch information
echlebek committed Dec 14, 2022
1 parent 9d5f639 commit e0202f3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions v3/provider.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package v3

import (
"context"

corev2 "github.com/sensu/core/v2"
)

// AuthProvider represents an abstracted authentication provider
type AuthProvider interface {
Resource

// Authenticate attempts to authenticate a user with its username and password
Authenticate(ctx context.Context, username, password string) (*corev2.Claims, error)
// Refresh renews the user claims with the provider claims
Refresh(ctx context.Context, claims *corev2.Claims) (*corev2.Claims, error)

// Name returns the provider name (e.g. default)
Name() string
// Type returns the provider type (e.g. ldap)
Type() string
}

0 comments on commit e0202f3

Please sign in to comment.