Documentation ¶
Index ¶
- Variables
- type BearerToken
- func (b *BearerToken) Issuer() *owner.ID
- func (b *BearerToken) Marshal(bs ...[]byte) ([]byte, error)
- func (b *BearerToken) MarshalJSON() ([]byte, error)
- func (b *BearerToken) SetEACLTable(table *eacl.Table)
- func (b *BearerToken) SetLifetime(exp, nbf, iat uint64)
- func (b *BearerToken) SetOwner(id *owner.ID)
- func (b *BearerToken) SignToken(key *ecdsa.PrivateKey) error
- func (b *BearerToken) ToV2() *acl.BearerToken
- func (b *BearerToken) Unmarshal(data []byte) error
- func (b *BearerToken) UnmarshalJSON(data []byte) error
- type SessionTokendeprecated
Constants ¶
This section is empty.
Variables ¶
var NewSessionToken = session.NewToken
NewSessionToken creates and returns blank session token.
Deprecated: use session.NewToken instead.
var NewSessionTokenFromV2 = session.NewTokenFromV2
NewSessionTokenFromV2 wraps session.SessionToken message structure into Token.
Deprecated: use session.NewTokenFromV2 instead.
Functions ¶
This section is empty.
Types ¶
type BearerToken ¶
type BearerToken struct {
// contains filtered or unexported fields
}
func NewBearerToken ¶
func NewBearerToken() *BearerToken
NewBearerToken creates and initializes blank BearerToken.
Defaults:
- signature: nil;
- eacl: nil;
- ownerID: nil;
- exp: 0;
- nbf: 0;
- iat: 0.
func NewBearerTokenFromV2 ¶
func NewBearerTokenFromV2(v2 *acl.BearerToken) *BearerToken
ToV2 converts BearerToken to v2 BearerToken message.
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
ToV2 converts BearerToken to v2 BearerToken message.
Nil BearerToken converts to nil.
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.