tokens

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KEY_BYTES = 32
)

Variables

This section is empty.

Functions

func SetService

func SetService(svc Service)

Types

type CreateGraphQLOptions added in v1.1.7

type CreateGraphQLOptions struct {
	EnvID  string
	Expiry time.Time
	Name   string
	Key    []byte
	Hash   string
}

type CreateOptions added in v1.1.7

type CreateOptions struct {
	OrgKey []byte
	EnvID  string
	Expiry time.Duration
	Name   string `json:"name,omitempty"`
}

type DecryptResponse added in v1.1.7

type DecryptResponse struct {
	OrgKey []byte
	EnvID  string
	Expiry time.Time
	Name   string
}

type DefaultService added in v1.1.7

type DefaultService struct{}

func (*DefaultService) Create added in v1.1.7

func (*DefaultService) Create(ctx context.ServiceContext, client *clients.GQLClient, options *CreateOptions) ([]byte, error)

func (*DefaultService) Decrypt added in v1.1.7

func (*DefaultService) Decrypt(ctx context.ServiceContext, client *clients.GQLClient, token, keyBytes []byte) ([]byte, error)

func (*DefaultService) Get added in v1.1.7

func (*DefaultService) GetByHash added in v1.1.7

func (*DefaultService) GetByHash(ctx context.ServiceContext, client *clients.GQLClient, hash string) (*Token, error)

func (*DefaultService) List added in v1.1.11

func (*DefaultService) List(ctx context.ServiceContext, client *clients.GQLClient, options *ListOptions) ([]*Token, error)

type GetGraphQLOptions added in v1.1.7

type GetGraphQLOptions struct {
	Hash string `json:"hash"`
}

type ListOptions added in v1.1.11

type ListOptions struct {
	EnvID string `json:"env_id,omitempty"`
}

func (*ListOptions) MarshalJSON added in v1.1.11

func (o *ListOptions) MarshalJSON() ([]byte, error)

Custom marshaller for list options/filters.

type Token added in v1.1.7

type Token struct {
	ID        string    `json:"id,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	UserID    string    `json:"user_id,omitempty"`
	EnvID     string    `json:"env_id,omitempty"`
	Expiry    time.Time `json:"expiry,omitempty"`
	Key       string    `json:"key,omitempty"`
	Hash      string    `json:"hash,omitempty"`
	Name      string    `json:"name,omitempty"`
}

func (*Token) IsExpired added in v1.1.7

func (t *Token) IsExpired() bool

IsExpired checks whether the token is expired or not.

Jump to

Keyboard shortcuts

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