bank-vaults: github.com/banzaicloud/bank-vaults/pkg/sdk/auth Index | Files

package auth

import "github.com/banzaicloud/bank-vaults/pkg/sdk/auth"

Index

Package Files

tokenstore.go

type Token Uses

type Token struct {
    ID        string     `json:"id"`
    Name      string     `json:"name"`
    ExpiresAt *time.Time `json:"expiresAt,omitempty"`
    CreatedAt *time.Time `json:"createdAt,omitempty"`
    Value     string     `json:"value,omitempty"`
}

Token represents an access token

func NewToken Uses

func NewToken(id, name string) *Token

NewToken Creates a new Token instance initialized ID and Name and CreatedAt fields

type TokenStore Uses

type TokenStore interface {
    Store(userID string, token *Token) error
    Lookup(userID string, tokenID string) (*Token, error)
    Exists(userID string, tokenID string) (bool, error)
    Revoke(userID string, tokenID string) error
    List(userID string) ([]*Token, error)
    GC() error
}

TokenStore is general interface for storing access tokens

func NewInMemoryTokenStore Uses

func NewInMemoryTokenStore() TokenStore

NewInMemoryTokenStore is a basic in-memory TokenStore implementation (thread-safe)

func NewVaultTokenStore Uses

func NewVaultTokenStore(role string) TokenStore

NewVaultTokenStore creates a new Vault backed token store

Package auth imports 6 packages (graph) and is imported by 2 packages. Updated 2019-10-02. Refresh now. Tools for package owners.