trireme-lib: Index | Files

package tokenaccessor

import ""


Package Files

interfaces.go tokenaccessor.go

type TokenAccessor Uses

type TokenAccessor interface {
    SetToken(serverID string, validity time.Duration, secret secrets.Secrets) error
    GetTokenValidity() time.Duration
    GetTokenServerID() string

    CreateAckPacketToken(context *pucontext.PUContext, auth *connection.AuthInfo) ([]byte, error)
    CreateSynPacketToken(context *pucontext.PUContext, auth *connection.AuthInfo) (token []byte, err error)
    CreateSynAckPacketToken(context *pucontext.PUContext, auth *connection.AuthInfo, claimsHeader *claimsheader.ClaimsHeader) (token []byte, err error)
    ParsePacketToken(auth *connection.AuthInfo, data []byte) (*tokens.ConnectionClaims, error)
    ParseAckToken(auth *connection.AuthInfo, data []byte) (*tokens.ConnectionClaims, error)

TokenAccessor define an interface to access LockedTokenEngine

func New Uses

func New(serverID string, validity time.Duration, secret secrets.Secrets) (TokenAccessor, error)

New creates a new instance of TokenAccessor interface

Package tokenaccessor imports 10 packages (graph) and is imported by 7 packages. Updated 2019-01-23. Refresh now. Tools for package owners.