auth

package
v0.0.0-...-e7ac155 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

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

func New

func New(jwtSecretKey []byte, dataverseClient *dataverse.Client, serviceID string) *Authenticator

func (*Authenticator) Authenticate

func (a *Authenticator) Authenticate(ctx context.Context, raw []byte) (string, error)

Authenticate verifies the provided verifiable credential and issue a related jwt access token if authentication succeeds.

func (*Authenticator) Authorize

func (a *Authenticator) Authorize(token string, uri *fasthttp.URI) (*ProxyClaims, error)

Authorize verifies the provided jwt access token.

type Permissions

type Permissions struct {
	Read []string `json:"read"`
}

type ProxyClaims

type ProxyClaims struct {
	jwt.StandardClaims
	Can Permissions `json:"can"`
}

func (*ProxyClaims) CanRead

func (c *ProxyClaims) CanRead(canFn func(uri string) bool) bool

Jump to

Keyboard shortcuts

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