Documentation ¶
Overview ¶
Package authorizationmodel contains cli specific auth model interfaces and functionality
Index ¶
- func ReadFromFile(fileName string, input *string, format *ModelFormat, storeName *string) error
- func ReadFromInputFile(fileName string, format *ModelFormat) (*string, error)
- func ReadFromInputFileOrArg(cmd *cobra.Command, args []string, fileNameArg string, isOptional bool, ...) error
- func ReadFromStore(clientConfig fga.ClientConfig, fgaClient client.SdkClient) (*openfga.ReadAuthorizationModelResponse, error)
- type AuthzModel
- func (model *AuthzModel) DisplayAsDSL(fields []string) (*string, error)
- func (model *AuthzModel) DisplayAsJSON(fields []string) AuthzModel
- func (model *AuthzModel) GetAsJSONString() (*string, error)
- func (model *AuthzModel) GetConditions() *map[string]openfga.Condition
- func (model *AuthzModel) GetCreatedAt() *time.Time
- func (model *AuthzModel) GetID() string
- func (model *AuthzModel) GetProtoModel() *pb.AuthorizationModel
- func (model *AuthzModel) GetSchemaVersion() string
- func (model *AuthzModel) GetTypeDefinitions() []openfga.TypeDefinition
- func (model *AuthzModel) ReadFromDSLString(dslString string) error
- func (model *AuthzModel) ReadFromJSONString(jsonString string) error
- func (model *AuthzModel) ReadModelFromModFGA(modFile string) error
- func (model *AuthzModel) ReadModelFromString(input string, format ModelFormat) error
- func (model *AuthzModel) Set(authzModel openfga.AuthorizationModel)
- type AuthzModelList
- type ModelFormat
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 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
Click to show internal directories.
Click to hide internal directories.