fs

package
v0.0.0-...-4f02c87 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package fs implements a filesystem-based auth.Authenticator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	FilePath   []string `json:"filepath"`
	Passphrase string   `json:"passphrase"`
}

Credentials is the authentication JSON structure used in Folder.Authenticate

type Folder

type Folder string

Folder is an implementation of auth.Authenticator that serves private keys from a folder path.

func (Folder) Authenticate

func (f Folder) Authenticate(credentials json.RawMessage) (json.RawMessage, error)

Authenticate parses credentials as Credentials and attempts to authenticate them. It follows the rules specified in auth.Authenticator.

func (Folder) ExchangeToken

func (f Folder) ExchangeToken(token json.RawMessage) (*auth.Key, error)

ExchangeToken exchanges a previously issued Token for an auth.Key. It follows the rules specified in auth.Authenticator.

func (Folder) RenewToken

func (f Folder) RenewToken(oldToken json.RawMessage) (json.RawMessage, error)

type Token

type Token struct {
	Secret  []byte    `json:"secret"`
	Expires time.Time `json:"expires"`
}

Token represents the carrier token structure returned by Folder.Authenticate

Jump to

Keyboard shortcuts

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