authorization

package
v0.1.51 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizeManyOptions added in v0.1.50

type AuthorizeManyOptions struct {
	AuthorizeManyPath string
	R                 *http.Request
	I                 []contract.Identifiable
	Role              contract.Role
}

type Client

type Client interface{}

func NewClient

func NewClient(d Dependencies, opts ClientOptions) (Client, error)

type ClientOption

type ClientOption func(*ClientOptions)

func WithAuthorizationTimeout

func WithAuthorizationTimeout(d time.Duration) ClientOption

func WithAuthorizationURL

func WithAuthorizationURL(u *url.URL) ClientOption

func WithUserIDHeaderKey

func WithUserIDHeaderKey(key string) ClientOption

type ClientOptions

type ClientOptions struct {
	UserIDHeaderKey      string
	AuthorizationTimeout time.Duration
	AuthorizationURL     *url.URL
}

func ApplyClientOptions

func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions

type DeleteOneOptions added in v0.1.50

type DeleteOneOptions struct {
	ID fmt.Stringer
	R  *http.Request
}

type Entity

type Entity struct {
	ID       *primitive.ObjectID   `json:"_id,omitempty"`
	EntityID *primitive.ObjectID   `json:"entity_id"`
	Readers  *[]primitive.ObjectID `json:"readers"`
	Writers  *[]primitive.ObjectID `json:"writers"`
	Owners   *[]primitive.ObjectID `json:"owners"`
}

func (*Entity) GetID

func (a *Entity) GetID() primitive.ObjectID

GetID returns the document ID.

func (*Entity) SetEntityID

func (a *Entity) SetEntityID(entityID primitive.ObjectID)

SetEntityID sets the entity ID.

func (*Entity) SetOwners

func (a *Entity) SetOwners(owners []primitive.ObjectID)

SetOwners sets the owners.

func (*Entity) SetReaders

func (a *Entity) SetReaders(readers []primitive.ObjectID)

SetReaders sets the readers.

func (*Entity) SetWriters

func (a *Entity) SetWriters(writers []primitive.ObjectID)

SetWriters sets the writers.

type FindOneOptions added in v0.1.50

type FindOneOptions struct {
	ID fmt.Stringer
	R  *http.Request
}

type InsertOneOptions added in v0.1.50

type InsertOneOptions struct {
	E *Entity
	R *http.Request
}

type ReplaceOneOptions added in v0.1.50

type ReplaceOneOptions struct {
	E  *Entity
	ID fmt.Stringer
	R  *http.Request
}

Jump to

Keyboard shortcuts

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