Documentation
¶
Index ¶
- Variables
- type ClientState
- type Issuer
- type IssuerConfig
- type IssuerTokenKey
- type MemoryClientStateCache
- type Origin
- type TestAttester
- type TokenStore
- func (s *TokenStore) AddToken(challenge string, token pat.Token)
- func (s *TokenStore) ConsumeToken(challenge string) (pat.Token, error)
- func (s *TokenStore) Equals(o *TokenStore) bool
- func (s *TokenStore) String() string
- func (s *TokenStore) Token(challenge string) (pat.Token, error)
- func (s *TokenStore) WriteToFile(fname string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Commands = []cli.Command{ { Name: "issuer", Usage: "Start a PAT issuer", Action: startIssuer, Flags: []cli.Flag{ cli.StringFlag{ Name: "cert, c", Value: "", Required: true, }, cli.StringFlag{ Name: "key, k", Value: "", Required: true, }, cli.StringFlag{ Name: "name", Value: "", Required: true, }, cli.StringFlag{ Name: "port", Value: "443", }, cli.StringSliceFlag{ Name: "origins", Usage: "Supported origins", }, cli.StringFlag{ Name: "log", Value: "error", }, }, }, { Name: "attester", Usage: "Start a PAT attester", Action: startAttester, Flags: []cli.Flag{ cli.StringFlag{ Name: "cert, c", Value: "", Required: true, }, cli.StringFlag{ Name: "key, k", Value: "", Required: true, }, cli.StringFlag{ Name: "port", Value: "443", }, cli.StringFlag{ Name: "log", Value: "error", }, }, }, { Name: "origin", Usage: "Start a PAT origin", Action: startOrigin, Flags: []cli.Flag{ cli.StringFlag{ Name: "cert, c", Value: "", Required: true, }, cli.StringFlag{ Name: "key, k", Value: "", Required: true, }, cli.StringFlag{ Name: "port", Value: "443", }, cli.StringFlag{ Name: "issuer", Value: "", Required: true, }, cli.StringFlag{ Name: "name", Value: "", Required: true, }, cli.StringFlag{ Name: "log", Value: "error", }, cli.StringSliceFlag{ Name: "origin-info", Usage: "Additional origins to include in origin_info", }, }, }, { Name: "fetch", Usage: "Fetch a resource protected using PAT", Action: runClientFetch, Flags: []cli.Flag{ cli.StringFlag{ Name: "id", Value: "default", }, cli.StringFlag{ Name: "origin", Value: "", Required: true, }, cli.StringFlag{ Name: "secret", Value: "", }, cli.StringFlag{ Name: "attester", Value: "", Required: true, }, cli.StringFlag{ Name: "resource", Value: "/index.html", }, cli.StringFlag{ Name: "store", Value: "", }, cli.IntFlag{ Name: "count", Value: 1, }, cli.BoolFlag{ Name: "non-interactive", Usage: "Flag to request non-interactive tokens", }, cli.BoolFlag{ Name: "cross-origin", Usage: "Flag to request cross-origin tokens", }, cli.StringFlag{ Name: "token-type", Usage: "Type of token protocol requested ['basic', 'rate-limited'], defaults to 'rate-limited'", }, cli.StringFlag{ Name: "log", Value: "error", }, }, }, { Name: "test", Usage: "Run through test cases for all possible token challenges", Action: runRunner, Flags: []cli.Flag{ cli.StringFlag{ Name: "id", Value: "default", }, cli.StringFlag{ Name: "origin", Value: "", Required: true, }, cli.StringFlag{ Name: "secret", Value: "", }, cli.StringFlag{ Name: "attester", Value: "", Required: true, }, cli.StringFlag{ Name: "resource", Value: "/index.html", }, }, }, }
View Source
var (
ErrInvalidBinaryHeader = errors.New("Invalid sf-binary header")
)
View Source
var (
ErrNoMatchingToken = errors.New("No matching token")
)
Functions ¶
This section is empty.
Types ¶
type ClientState ¶
type ClientState struct {
// contains filtered or unexported fields
}
type IssuerConfig ¶
type IssuerConfig struct { TokenWindow int `json:"issuer-token-window"` // policy window RequestURI string `json:"issuer-request-uri"` // request URI TokenKeys []IssuerTokenKey `json:"token-keys"` // per-origin token key IssuerEncapKeyURI string `json:"issuer-encap-key-uri"` // issuer encapsulation key URI }
type IssuerTokenKey ¶
type MemoryClientStateCache ¶
type MemoryClientStateCache struct {
// contains filtered or unexported fields
}
func NewMemoryClientStateCache ¶
func NewMemoryClientStateCache() MemoryClientStateCache
func (MemoryClientStateCache) Get ¶
func (c MemoryClientStateCache) Get(clientID string) (*pat.ClientState, bool)
func (MemoryClientStateCache) Put ¶
func (c MemoryClientStateCache) Put(clientID string, state *pat.ClientState)
type TestAttester ¶
type TestAttester struct {
// contains filtered or unexported fields
}
type TokenStore ¶
type TokenStore struct {
// contains filtered or unexported fields
}
func EmptyStore ¶
func EmptyStore() *TokenStore
func ReadStoreFromFile ¶
func ReadStoreFromFile(fname string) (*TokenStore, error)
func (*TokenStore) ConsumeToken ¶
func (s *TokenStore) ConsumeToken(challenge string) (pat.Token, error)
func (*TokenStore) Equals ¶
func (s *TokenStore) Equals(o *TokenStore) bool
func (*TokenStore) String ¶
func (s *TokenStore) String() string
func (*TokenStore) WriteToFile ¶
func (s *TokenStore) WriteToFile(fname string) error
Click to show internal directories.
Click to hide internal directories.