Versions in this module Expand all Collapse all v0 v0.0.4 Dec 4, 2018 v0.0.3 Dec 3, 2018 Changes in this version + const AccountClaim + const ActivationClaim + const AlgorithmNkey + const ClusterClaim + const OperatorClaim + const RevocationClaim + const ServerClaim + const TokenTypeJwt + const UserClaim + const Version + func Decode(token string, target Claims) error + type Account struct + Exports Exports + Identities []Identity + Imports Imports + Limits OperatorLimits + func (a *Account) Validate(acct *AccountClaims, vr *ValidationResults) + type AccountClaims struct + func DecodeAccountClaims(token string) (*AccountClaims, error) + func NewAccountClaims(subject string) *AccountClaims + func (a *AccountClaims) Claims() *ClaimsData + func (a *AccountClaims) Encode(pair nkeys.KeyPair) (string, error) + func (a *AccountClaims) ExpectedPrefixes() []nkeys.PrefixByte + func (a *AccountClaims) Payload() interface{} + func (a *AccountClaims) String() string + func (a *AccountClaims) Validate(vr *ValidationResults) + type Activation struct + ImportSubject Subject + ImportType ExportType + func (a *Activation) IsService() bool + func (a *Activation) IsStream() bool + func (a *Activation) Validate(vr *ValidationResults) + type ActivationClaims struct + func DecodeActivationClaims(token string) (*ActivationClaims, error) + func NewActivationClaims(subject string) *ActivationClaims + func (a *ActivationClaims) Claims() *ClaimsData + func (a *ActivationClaims) Encode(pair nkeys.KeyPair) (string, error) + func (a *ActivationClaims) ExpectedPrefixes() []nkeys.PrefixByte + func (a *ActivationClaims) HashID() (string, error) + func (a *ActivationClaims) Payload() interface{} + func (a *ActivationClaims) String() string + func (a *ActivationClaims) Validate(vr *ValidationResults) + type ClaimType string + type Claims interface + Claims func() *ClaimsData + Encode func(kp nkeys.KeyPair) (string, error) + ExpectedPrefixes func() []nkeys.PrefixByte + Payload func() interface{} + String func() string + Validate func(vr *ValidationResults) + Verify func(payload string, sig []byte) bool + type ClaimsData struct + Audience string + Expires int64 + ID string + IssuedAt int64 + Issuer string + Name string + NotBefore int64 + Subject string + Tags TagList + Type ClaimType + func (c *ClaimsData) IsSelfSigned() bool + func (c *ClaimsData) String(claim interface{}) string + func (c *ClaimsData) Validate(vr *ValidationResults) + func (c *ClaimsData) Verify(payload string, sig []byte) bool + type Cluster struct + AccountURL string + Accounts []string + OperatorURL string + Trust []string + func (c *Cluster) Validate(vr *ValidationResults) + type ClusterClaims struct + func DecodeClusterClaims(token string) (*ClusterClaims, error) + func NewClusterClaims(subject string) *ClusterClaims + func (c *ClusterClaims) Claims() *ClaimsData + func (c *ClusterClaims) Encode(pair nkeys.KeyPair) (string, error) + func (c *ClusterClaims) ExpectedPrefixes() []nkeys.PrefixByte + func (c *ClusterClaims) Payload() interface{} + func (c *ClusterClaims) String() string + func (c *ClusterClaims) Validate(vr *ValidationResults) + type Export struct + Name string + Subject Subject + TokenReq bool + Type ExportType + func (e *Export) IsService() bool + func (e *Export) IsStream() bool + func (e *Export) Validate(vr *ValidationResults) + type ExportType int + const Service + const Stream + const Unknown + func (t *ExportType) MarshalJSON() ([]byte, error) + func (t *ExportType) UnmarshalJSON(b []byte) error + func (t ExportType) String() string + type Exports []*Export + func (e *Exports) Add(i ...*Export) + func (e *Exports) HasExportContainingSubject(subject Subject) bool + func (e *Exports) Validate(vr *ValidationResults) error + type GenericClaims struct + Data map[string]interface{} + func DecodeGeneric(token string) (*GenericClaims, error) + func NewGenericClaims(subject string) *GenericClaims + func (gc *GenericClaims) Claims() *ClaimsData + func (gc *GenericClaims) Encode(pair nkeys.KeyPair) (string, error) + func (gc *GenericClaims) ExpectedPrefixes() []nkeys.PrefixByte + func (gc *GenericClaims) Payload() interface{} + func (gc *GenericClaims) String() string + func (gc *GenericClaims) Validate(vr *ValidationResults) + type Header struct + Algorithm string + Type string + func (h *Header) Valid() error + type Identity struct + ID string + Proof string + func (u *Identity) Validate(vr *ValidationResults) + type Import struct + Account string + Name string + Subject Subject + To Subject + Token string + Type ExportType + func (i *Import) IsService() bool + func (i *Import) IsStream() bool + func (i *Import) Validate(actPubKey string, vr *ValidationResults) + type Imports []*Import + func (i *Imports) Add(a ...*Import) + func (i *Imports) Validate(acctPubKey string, vr *ValidationResults) + type Limits struct + Max int64 + Payload int64 + Src string + Times []TimeRange + func (l *Limits) Validate(vr *ValidationResults) + type NamedSubject struct + Name string + Subject Subject + func (ns *NamedSubject) Validate(vr *ValidationResults) + type Operator struct + Identities []Identity + SigningKeys []string + func (o *Operator) Validate(vr *ValidationResults) + type OperatorClaims struct + func DecodeOperatorClaims(token string) (*OperatorClaims, error) + func NewOperatorClaims(subject string) *OperatorClaims + func (s *OperatorClaims) AddSigningKey(pk string) + func (s *OperatorClaims) Claims() *ClaimsData + func (s *OperatorClaims) DidSign(op Claims) bool + func (s *OperatorClaims) Encode(pair nkeys.KeyPair) (string, error) + func (s *OperatorClaims) ExpectedPrefixes() []nkeys.PrefixByte + func (s *OperatorClaims) Payload() interface{} + func (s *OperatorClaims) String() string + func (s *OperatorClaims) Validate(vr *ValidationResults) + type OperatorLimits struct + Conn int64 + Data int64 + Exports int64 + Imports int64 + Payload int64 + Subs int64 + WildcardExports bool + func (o *OperatorLimits) IsEmpty() bool + func (o *OperatorLimits) Validate(vr *ValidationResults) + type Permission struct + Allow StringList + Deny StringList + func (p *Permission) Validate(vr *ValidationResults) + type Permissions struct + Pub Permission + Sub Permission + func (p *Permissions) Validate(vr *ValidationResults) + type Prefix struct + type Revocation struct + JWT string + Reason string + func (u *Revocation) Validate(vr *ValidationResults) + type RevocationClaims struct + func DecodeRevocationClaims(token string) (*RevocationClaims, error) + func NewRevocationClaims(subject string) *RevocationClaims + func (rc *RevocationClaims) Claims() *ClaimsData + func (rc *RevocationClaims) Encode(pair nkeys.KeyPair) (string, error) + func (rc *RevocationClaims) ExpectedPrefixes() []nkeys.PrefixByte + func (rc *RevocationClaims) Payload() interface{} + func (rc *RevocationClaims) String() string + func (rc *RevocationClaims) Validate(vr *ValidationResults) + type Server struct + Cluster string + func (s *Server) Validate(vr *ValidationResults) + type ServerClaims struct + func DecodeServerClaims(token string) (*ServerClaims, error) + func NewServerClaims(subject string) *ServerClaims + func (s *ServerClaims) Claims() *ClaimsData + func (s *ServerClaims) Encode(pair nkeys.KeyPair) (string, error) + func (s *ServerClaims) ExpectedPrefixes() []nkeys.PrefixByte + func (s *ServerClaims) Payload() interface{} + func (s *ServerClaims) String() string + func (s *ServerClaims) Validate(vr *ValidationResults) + type StringList []string + func (u *StringList) Add(p ...string) + func (u *StringList) Contains(p string) bool + func (u *StringList) Remove(p ...string) + type Subject string + func (s Subject) HasWildCards() bool + func (s Subject) IsContainedIn(other Subject) bool + func (s Subject) Validate(vr *ValidationResults) + type TagList []string + func (u *TagList) Add(p ...string) + func (u *TagList) Contains(p string) bool + func (u *TagList) Remove(p ...string) + type TimeRange struct + End string + Start string + func (tr *TimeRange) Validate(vr *ValidationResults) + type User struct + func (u *User) Validate(vr *ValidationResults) + type UserClaims struct + func DecodeUserClaims(token string) (*UserClaims, error) + func NewUserClaims(subject string) *UserClaims + func (u *UserClaims) Claims() *ClaimsData + func (u *UserClaims) Encode(pair nkeys.KeyPair) (string, error) + func (u *UserClaims) ExpectedPrefixes() []nkeys.PrefixByte + func (u *UserClaims) Payload() interface{} + func (u *UserClaims) String() string + func (u *UserClaims) Validate(vr *ValidationResults) + type ValidationIssue struct + Blocking bool + Description string + TimeCheck bool + func (ve *ValidationIssue) Error() string + type ValidationResults struct + Issues []*ValidationIssue + func CreateValidationResults() *ValidationResults + func (v *ValidationResults) Add(vi *ValidationIssue) + func (v *ValidationResults) AddError(format string, args ...interface{}) + func (v *ValidationResults) AddTimeCheck(format string, args ...interface{}) + func (v *ValidationResults) AddWarning(format string, args ...interface{}) + func (v *ValidationResults) IsBlocking(includeTimeChecks bool) bool + func (v *ValidationResults) IsEmpty() bool