auth

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertAndNormaliseRoles

func ConvertAndNormaliseRoles(in interface{}) ([]string, error)

ConvertAndNormaliseRoles converts claim roles. normalise it, because `roles` could be represented as a one role(string) or array of roles(slice).

Types

type OIDCClient

type OIDCClient struct {
	// contains filtered or unexported fields
}

OIDCClient represents OIDC client.

func NewOIDCClient

func NewOIDCClient(ctx context.Context, config *auth.Config) (*OIDCClient, error)

NewOIDCClient creates new OIDC client

func (OIDCClient) Verify

func (c OIDCClient) Verify(ctx context.Context, accessToken string) (*User, error)

Verify makes Access Token verification.

type OIDCClientProvider

type OIDCClientProvider interface {
	// Verify makes Access Token verification.
	Verify(ctx context.Context, accessToken string) (*User, error)
}

OIDCClientProvider provides an interface to work with OIDC provider.

type User

type User struct {
	// contains filtered or unexported fields
}

User represents object to store current user information.

func (User) GetRoles

func (u User) GetRoles() []string

GetRoles returns current user roles.

func (User) IsAdmin

func (u User) IsAdmin() bool

IsAdmin makes check that current user is Admin user.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL