auth

package
v1.18.2 Latest Latest
Warning

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

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

Documentation

Overview

Package auth provides authentication and authorization capability

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	// Generate a new auth token
	Generate(string) (*Token, error)
	// Revoke an authorization token
	Revoke(*Token) error
	// Grant access to a resource
	Grant(*Token, *Service) error
	// Verify a token can access a resource
	Verify(*Token, *Service) error
}

Auth providers authentication and authorization

type Service

type Service struct {
	// Name of the resource
	Name string
	// Endpoint is the specific endpoint
	Endpoint string
}

Service is some thing to provide access to

type Token

type Token struct {
	// Unique token id
	Id string `json: "id"`
	// Time of token creation
	Created time.Time `json:"created"`
	// Time of token expiry
	Expiry time.Time `json:"expiry"`
	// Roles associated with the token
	Roles []string `json:"roles"`
	// Any other associated metadata
	Metadata map[string]string `json:"metadata"`
}

Token providers by an auth provider

Jump to

Keyboard shortcuts

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