authorizationjuice

package
v1.36.13 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Struct tags.
	RoleIntRange StructTag = "roleintrange"

	// Various keys.
	EntityIDsKey         Key = "entity_ids"
	EntityIDKey          Key = "entity_id"
	PrincipalIDKey       Key = "principal_id"
	RoleKey              Key = "role"
	UnallowedEntitiesKey Key = "unallowed_entities"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizeMany added in v1.36.0

type AuthorizeMany struct {
	// A list of MongoDB Object IDs representing the entities to be authorized.
	// example: [5f8f9a9a9a9a9a9a9a9a9a9a, 5f8f9a9a9a9a9a9a9a9a9a9a]
	// required: true
	EntityIDs *[]primitive.ObjectID `json:"entity_ids" validate:"nonnilpointer"`

	// The MongoDB Object ID of the principal being authorized to access the entities.
	// example: 5f8f9a9a9a9a9a9a9a9a9a9a
	// required: true
	PrincipalID *primitive.ObjectID `json:"principal_id" validate:"nonnilpointer,nonzeropointerelem"`

	// The role assigned to the principal for the authorized entities. Must be a valid integer role as defined in authorization microservice.
	// example: 1
	// required: true
	Role *int64 `json:"role" validate:"nonnilpointer,roleintrange"`
}

AuthorizeMany represents the payload required to authorize multiple entities. swagger:model

func NewAuthorizeMany added in v1.36.0

func NewAuthorizeMany(
	entityIDs []primitive.ObjectID,
	principalID primitive.ObjectID,
	role int64,
) *AuthorizeMany

func (*AuthorizeMany) GetEntityIDs added in v1.36.0

func (a *AuthorizeMany) GetEntityIDs() []primitive.ObjectID

func (*AuthorizeMany) GetPrincipalID added in v1.36.0

func (a *AuthorizeMany) GetPrincipalID() primitive.ObjectID

func (*AuthorizeMany) GetRole added in v1.36.0

func (a *AuthorizeMany) GetRole() int64

func (*AuthorizeMany) SetEntityIDs added in v1.36.0

func (a *AuthorizeMany) SetEntityIDs(entityIDs []primitive.ObjectID)

func (*AuthorizeMany) SetPrincipalID added in v1.36.0

func (a *AuthorizeMany) SetPrincipalID(principalID primitive.ObjectID)

func (*AuthorizeMany) SetRole added in v1.36.0

func (a *AuthorizeMany) SetRole(role int64)

type AuthorizeManyResponse added in v1.36.1

type AuthorizeManyResponse struct {
	// The unauthorized entity IDs.
	// example: [5f6d4b9b9c6f9f0001b9c6f9]
	UnallowedEntities []primitive.ObjectID `json:"unallowed_entities"`
}

AuthorizeManyResponse represents an authorization response for the authorization of multiple entities where a list of unauthorized entity IDs is returned. swagger:model

type AuthorizeResponse added in v1.36.1

type AuthorizeResponse struct {
	// The status code.
	// example: 200
	Code int `json:"code"`
}

AuthorizeResponse represents an authorization response for a single entity where a simple status code is returned. swagger:model

type Key

type Key = string

Aliases.

type StructTag added in v1.36.0

type StructTag = string

Aliases.

Jump to

Keyboard shortcuts

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