authorizationmodel

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package authorizationmodel contains cli specific auth model interfaces and functionality

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFromFile

func ReadFromFile(
	fileName string,
	input *string,
	format *ModelFormat,
	storeName *string,
) error

func ReadFromInputFile

func ReadFromInputFile(
	fileName string,
	format *ModelFormat,
) (*string, error)

func ReadFromInputFileOrArg

func ReadFromInputFileOrArg(
	cmd *cobra.Command,
	args []string,
	fileNameArg string,
	isOptional bool,
	input *string,
	storeName *string,
	format *ModelFormat,
) error

func ReadFromStore added in v0.3.1

func ReadFromStore(clientConfig fga.ClientConfig, fgaClient client.SdkClient) (*openfga.ReadAuthorizationModelResponse, error)

ReadFromStore reads the model from the store with the given the AuthorizationModelID, or the latest model if no ID was provided.

Types

type AuthzModel

type AuthzModel struct {
	ID              *string                       `json:"id,omitempty"`
	CreatedAt       *time.Time                    `json:"created_at,omitempty"`
	SchemaVersion   *string                       `json:"schema_version,omitempty"`
	TypeDefinitions *[]openfga.TypeDefinition     `json:"type_definitions,omitempty"`
	Conditions      map[string]*openfga.Condition `json:"conditions,omitempty"`
}

func (*AuthzModel) DisplayAsDSL

func (model *AuthzModel) DisplayAsDSL(fields []string) (*string, error)

func (*AuthzModel) DisplayAsJSON

func (model *AuthzModel) DisplayAsJSON(fields []string) AuthzModel

func (*AuthzModel) GetAsJSONString

func (model *AuthzModel) GetAsJSONString() (*string, error)

func (*AuthzModel) GetConditions added in v0.2.5

func (model *AuthzModel) GetConditions() *map[string]openfga.Condition

func (*AuthzModel) GetCreatedAt

func (model *AuthzModel) GetCreatedAt() *time.Time

func (*AuthzModel) GetID

func (model *AuthzModel) GetID() string

func (*AuthzModel) GetProtoModel

func (model *AuthzModel) GetProtoModel() *pb.AuthorizationModel

func (*AuthzModel) GetSchemaVersion

func (model *AuthzModel) GetSchemaVersion() string

func (*AuthzModel) GetTypeDefinitions

func (model *AuthzModel) GetTypeDefinitions() []openfga.TypeDefinition

func (*AuthzModel) ReadFromDSLString

func (model *AuthzModel) ReadFromDSLString(dslString string) error

func (*AuthzModel) ReadFromJSONString

func (model *AuthzModel) ReadFromJSONString(jsonString string) error

func (*AuthzModel) ReadModelFromModFGA added in v0.3.0

func (model *AuthzModel) ReadModelFromModFGA(modFile string) error

func (*AuthzModel) ReadModelFromString

func (model *AuthzModel) ReadModelFromString(input string, format ModelFormat) error

func (*AuthzModel) Set

func (model *AuthzModel) Set(authzModel openfga.AuthorizationModel)

type AuthzModelList

type AuthzModelList struct {
	AuthorizationModels []AuthzModel `json:"authorization_models"`
}

type ModelFormat

type ModelFormat string
const (
	ModelFormatDefault ModelFormat = "default"
	ModelFormatJSON    ModelFormat = "json"
	ModelFormatFGA     ModelFormat = "fga"
	ModelFormatModular ModelFormat = "modular"
)

func (*ModelFormat) Set

func (format *ModelFormat) Set(v string) error

func (*ModelFormat) String

func (format *ModelFormat) String() string

func (*ModelFormat) Type

func (format *ModelFormat) Type() string

Jump to

Keyboard shortcuts

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