auth

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(claims jwt.Claims, key *ecdsa.PrivateKey) (string, error)

func GenerateRefreshToken

func GenerateRefreshToken() (string, string, error)

func HashRefreshToken

func HashRefreshToken(token string) string

func Verify

func Verify(accessToken string, key ecdsa.PublicKey) (*jwt.Token, error)

Types

type AuthInterceptor

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

func NewAuthInterceptor

func NewAuthInterceptor(accessibleRoles map[string][]string, pubKey ecdsa.PublicKey) *AuthInterceptor

func (*AuthInterceptor) Stream

func (*AuthInterceptor) Unary

type LeaseClaims

type LeaseClaims struct {
	Resource     string   `json:"resource"`
	Scope        []string `json:"scope"`
	LeaseID      string   `json:"lease_id"`
	FencingToken uint64   `json:"fencing_token"`
	jwt.RegisteredClaims
}

func NewLeaseClaim

func NewLeaseClaim(taskID, nodeID, leaseID string, expiresAt time.Time) *LeaseClaims

Jump to

Keyboard shortcuts

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