tokenizer

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateAccessPolicyRequest

type CreateAccessPolicyRequest struct {
	AccessPolicy policy.AccessPolicy `json:"access_policy"`
}

CreateAccessPolicyRequest creates a new AP

type CreateAccessPolicyTemplateRequest

type CreateAccessPolicyTemplateRequest struct {
	AccessPolicyTemplate policy.AccessPolicyTemplate `json:"access_policy_template"`
}

CreateAccessPolicyTemplateRequest creates a new AP Template

type CreateTokenRequest

type CreateTokenRequest struct {
	Data string `json:"data"`

	TransformerRID  userstore.ResourceID `json:"transformer_rid"`
	AccessPolicyRID userstore.ResourceID `json:"access_policy_rid"`
}

CreateTokenRequest is all the data needed to create a token

func (CreateTokenRequest) Validate

func (o CreateTokenRequest) Validate() error

Validate implements Validateable

type CreateTokenResponse

type CreateTokenResponse struct {
	Token string `json:"data"`
}

CreateTokenResponse is the response to a CreateToken call

type CreateTransformerRequest

type CreateTransformerRequest struct {
	Transformer policy.Transformer `json:"transformer"`
}

CreateTransformerRequest creates a new GP

type InspectTokenRequest

type InspectTokenRequest struct {
	Token string `json:"token" validate:"notempty"`
}

InspectTokenRequest contains the data required to inspect a token

func (InspectTokenRequest) Validate

func (o InspectTokenRequest) Validate() error

Validate implements Validateable

type InspectTokenResponse

type InspectTokenResponse struct {
	Token string `json:"token"`

	ID      uuid.UUID `json:"id"`
	Created time.Time `json:"created"`
	Updated time.Time `json:"updated"`

	AccessPolicy policy.AccessPolicy `json:"access_policy"`

	// TODO: should we embed this in AP always?
	CurrentAccessPolicyVersion int `json:"current_access_policy_version"`

	Transformer policy.Transformer `json:"transformer"`
}

InspectTokenResponse contains the data returned by an InspectToken call

type LookupOrCreateTokensRequest added in v0.7.1

type LookupOrCreateTokensRequest struct {
	Data []string `json:"data" validate:"skip"`

	TransformerRIDs  []userstore.ResourceID `json:"transformer_rids"`
	AccessPolicyRIDs []userstore.ResourceID `json:"access_policy_rids"`
}

LookupOrCreateTokensRequest contains the data required to lookup or create tokens in bulk

func (LookupOrCreateTokensRequest) Validate added in v0.7.1

func (o LookupOrCreateTokensRequest) Validate() error

Validate implements Validateable

type LookupOrCreateTokensResponse added in v0.7.1

type LookupOrCreateTokensResponse struct {
	Tokens []string `json:"tokens"`
}

LookupOrCreateTokensResponse contains the data returned by a LookupOrCreateTokens call

type LookupTokensRequest

type LookupTokensRequest struct {
	Data string `json:"data"`

	TransformerRID  userstore.ResourceID `json:"transformer_rid"`
	AccessPolicyRID userstore.ResourceID `json:"access_policy_rid"`
}

LookupTokensRequest contains the data required to lookup a token

func (LookupTokensRequest) Validate

func (o LookupTokensRequest) Validate() error

Validate implements Validateable

type LookupTokensResponse

type LookupTokensResponse struct {
	Tokens []string `json:"tokens"` // note that a single piece of data could tokenize many ways
}

LookupTokensResponse contains the data returned by a LookupToken call

type ResolveTokenResponse

type ResolveTokenResponse struct {
	Data  string `json:"data"`
	Token string `json:"token"` // include this in case it's helpful for correlating later?
}

ResolveTokenResponse is the response to a ResolveToken call

type ResolveTokensRequest

type ResolveTokensRequest struct {
	Tokens   []string               `json:"tokens"`
	Context  policy.ClientContext   `json:"context"`
	Purposes []userstore.ResourceID `json:"purposes"`
}

ResolveTokensRequest is the data needed to resolve a token

func (ResolveTokensRequest) Validate

func (r ResolveTokensRequest) Validate() error

Validate implements Validateable

type TestAccessPolicyRequest

type TestAccessPolicyRequest struct {
	AccessPolicy policy.AccessPolicy        `json:"access_policy"`
	Context      policy.AccessPolicyContext `json:"context"`
}

TestAccessPolicyRequest lets you run an unsaved policy with a given context for testing

func (TestAccessPolicyRequest) Validate added in v1.0.0

func (o TestAccessPolicyRequest) Validate() error

Validate implements Validateable

type TestAccessPolicyResponse

type TestAccessPolicyResponse struct {
	Allowed bool                   `json:"allowed"`
	Debug   map[string]interface{} `json:"debug,omitempty"`
}

TestAccessPolicyResponse is the response to a TestAccessPolicy call

type TestAccessPolicyTemplateRequest added in v0.8.0

type TestAccessPolicyTemplateRequest struct {
	AccessPolicyTemplate policy.AccessPolicyTemplate `json:"access_policy_template"`
	Context              policy.AccessPolicyContext  `json:"context"`
	Params               string                      `json:"params"`
}

TestAccessPolicyTemplateRequest lets you run an unsaved policy template with a given context for testing

func (TestAccessPolicyTemplateRequest) Validate added in v1.0.0

Validate implements Validateable

type TestTransformerRequest

type TestTransformerRequest struct {
	Transformer policy.Transformer `json:"transformer"`
	Data        string             `json:"data"`
}

TestTransformerRequest lets you run an unsaved policy for testing

func (TestTransformerRequest) Validate

func (o TestTransformerRequest) Validate() error

Validate implements Validateable

type TestTransformerResponse

type TestTransformerResponse struct {
	Value string                 `json:"value"`
	Debug map[string]interface{} `json:"debug,omitempty"`
}

TestTransformerResponse is the response to a TestTransformer call

type UpdateAccessPolicyRequest

type UpdateAccessPolicyRequest struct {
	AccessPolicy policy.AccessPolicy `json:"access_policy"`
}

UpdateAccessPolicyRequest updates an AP by creating a new version

type UpdateAccessPolicyTemplateRequest

type UpdateAccessPolicyTemplateRequest struct {
	AccessPolicyTemplate policy.AccessPolicyTemplate `json:"access_policy_template"`
}

UpdateAccessPolicyTemplateRequest updates an AP Template

Jump to

Keyboard shortcuts

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