policyset

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(opts Opts) Client

func NewFromConfig

func NewFromConfig(cfg *config.Context) Client

func (*Client) Create

func (c *Client) Create(ctx context.Context, input CreateInput) (*CreateOutput, error)

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, input DeleteInput) (DeleteOutput, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, input GetInput) (GetOutput, error)

func (*Client) List

func (c *Client) List(ctx context.Context, input ListInput) (ListOutput, error)

func (*Client) ListPolicySetsRequest

func (c *Client) ListPolicySetsRequest(input ListInput) *listPolicySetsRequestCall

func (*Client) Update

func (c *Client) Update(ctx context.Context, input UpdateInput) (*UpdateOutput, error)

type CreateInput

type CreateInput struct {
	PolicySet Input
}

type DeleteInput

type DeleteInput struct {
	ID string
}

type DeleteOutput

type DeleteOutput struct {
	ID string
}

type GetInput

type GetInput struct {
	ID string
}

type GetOutput

type GetOutput struct {
	PolicySet PolicySet `json:"policySet"`
}

type Input

type Input struct {
	// ID of the policy.
	ID string `json:"id"`
	// Text is the Cedar source code for the policy.
	Text string `json:"text"`
}

Input is the input to create a PolicySet

func (Input) ToAPI

func (p Input) ToAPI() *authzv1alpha1.PolicySetInput

type ListInput

type ListInput struct {
	PageToken string
}

type ListOutput

type ListOutput struct {
	PolicySets    []PolicySet `json:"policySets"`
	NextPageToken string      `json:"nextPageToken,omitempty"`
}

type Opts

type Opts struct {
	HTTPClient    connect.HTTPClient
	BaseURL       string
	ClientOptions []connect.ClientOption
}

type Policy

type Policy struct {
	// ID of the policy.
	ID string `json:"id"`
	// Text is the Cedar source code for the policy.
	Text string `json:"text"`
}

Policy is an authorization policy used to make access decisions.

func PolicyFromAPI

func PolicyFromAPI(input *authzv1alpha1.Policy) Policy

func (*Policy) ToAPI added in v1.35.1

func (p *Policy) ToAPI() *authzv1alpha1.Policy

type PolicySet

type PolicySet struct {
	// ID of the policy.
	ID string `json:"id"`

	Policies []Policy `json:"policies"`

	Text string `json:"text"`
}

PolicySet is a set of Policies

func FromAPI

func FromAPI(input *authzv1alpha1.PolicySet) PolicySet

func (*PolicySet) ToAPI added in v1.35.1

func (ps *PolicySet) ToAPI() *authzv1alpha1.PolicySet

type UpdateInput

type UpdateInput struct {
	PolicySet Input
}

Jump to

Keyboard shortcuts

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