Skip to content

Commit

Permalink
Merge pull request #1 from sensu/add-provider
Browse files Browse the repository at this point in the history
Add core/v3.AuthProvider
  • Loading branch information
echlebek committed Dec 14, 2022
2 parents 9d5f639 + e0202f3 commit 952ff30
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 952ff30

Please sign in to comment.