token

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BearerToken

type BearerToken struct {
	// contains filtered or unexported fields
}

func NewBearerToken

func NewBearerToken() *BearerToken

func NewBearerTokenFromV2

func NewBearerTokenFromV2(v2 *acl.BearerToken) *BearerToken

func (*BearerToken) Issuer

func (b *BearerToken) Issuer() *owner.ID

Issuer returns owner.ID associated with the key that signed bearer token. To pass node validation it should be owner of requested container. Returns nil if token is not signed.

func (*BearerToken) Marshal

func (b *BearerToken) Marshal(bs ...[]byte) ([]byte, error)

Marshal marshals BearerToken into a protobuf binary form.

Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.

func (*BearerToken) MarshalJSON

func (b *BearerToken) MarshalJSON() ([]byte, error)

MarshalJSON encodes BearerToken to protobuf JSON format.

func (*BearerToken) SetEACLTable

func (b *BearerToken) SetEACLTable(table *eacl.Table)

func (*BearerToken) SetLifetime

func (b *BearerToken) SetLifetime(exp, nbf, iat uint64)

func (*BearerToken) SetOwner

func (b *BearerToken) SetOwner(id *owner.ID)

func (*BearerToken) SignToken

func (b *BearerToken) SignToken(key *ecdsa.PrivateKey) error

func (BearerToken) ToV2

func (b BearerToken) ToV2() *acl.BearerToken

func (*BearerToken) Unmarshal

func (b *BearerToken) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of BearerToken.

func (*BearerToken) UnmarshalJSON

func (b *BearerToken) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes BearerToken from protobuf JSON format.

type SessionToken

type SessionToken session.SessionToken

func NewSessionToken

func NewSessionToken() *SessionToken

func NewSessionTokenFromV2

func NewSessionTokenFromV2(tV2 *session.SessionToken) *SessionToken

func (*SessionToken) ID

func (t *SessionToken) ID() []byte

func (*SessionToken) Marshal

func (t *SessionToken) Marshal(bs ...[]byte) ([]byte, error)

Marshal marshals SessionToken into a protobuf binary form.

Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.

func (*SessionToken) MarshalJSON

func (t *SessionToken) MarshalJSON() ([]byte, error)

MarshalJSON encodes SessionToken to protobuf JSON format.

func (*SessionToken) OwnerID

func (t *SessionToken) OwnerID() *owner.ID

func (*SessionToken) SessionKey

func (t *SessionToken) SessionKey() []byte

func (*SessionToken) SetID

func (t *SessionToken) SetID(v []byte)

func (*SessionToken) SetOwnerID

func (t *SessionToken) SetOwnerID(v *owner.ID)

func (*SessionToken) SetSessionKey

func (t *SessionToken) SetSessionKey(v []byte)

func (*SessionToken) Signature

func (t *SessionToken) Signature() *pkg.Signature

func (*SessionToken) ToV2

func (t *SessionToken) ToV2() *session.SessionToken

func (*SessionToken) Unmarshal

func (t *SessionToken) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of SessionToken.

func (*SessionToken) UnmarshalJSON

func (t *SessionToken) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes SessionToken from protobuf JSON format.

Jump to

Keyboard shortcuts

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