pledge

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 7 Imported by: 0

README

🔐 pledge RELEASE

SDK to provide different types of standard authentication & authorization capabilities

Supported standards

  • JWT

Execution

Valid pledge level configurations should be set up before identity generation/verification

go run cmd/example.go

Testing

go test ./... -cover -race

Documentation

Index

Constants

View Source
const (
	// AuthMethodJWT defines value JWT authentication
	AuthMethodJWT = "JWT"
)

Variables

This section is empty.

Functions

func SetConfig

func SetConfig(conf *Config)

SetConfig sets pledge level configurations

Types

type Auth

type Auth interface {
	GenerateIdentitiy(interface{}) (interface{}, error)
	VerifyIdentity(args ...interface{}) (interface{}, error)
}

Auth is generic interface for authentication

func New

func New(method string, publisher bool, conf *Config) (Auth, error)

New provides an instance of implementation of Auth interface according to requested auth method

type Config

type Config struct {
	Issuer         string `yaml:"issuer"`
	PublicKeyPath  string `yaml:"publickeypath"`
	PrivateKeyPath string `yaml:"privatekeypath"`
}

Config defines all the attributes required to set up pledge

func GetConfig

func GetConfig() *Config

GetConfig returns pledge level configurations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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