openfgacheck

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	TupleKey             TupleKey `json:"tuple_key"`
	AuthorizationModelID string   `json:"authorization_model_id"`
}

type CheckResponse

type CheckResponse struct {
	Allowed bool `json:"allowed"`
}

type Method

type Method struct {
	HEAD    string `cfg:"head"`
	OPTIONS string `cfg:"options"`
	CONNECT string `cfg:"connect"`
	TRACE   string `cfg:"trace"`
	GET     string `cfg:"get"`

	POST   string `cfg:"post"`
	PATCH  string `cfg:"patch"`
	PUT    string `cfg:"put"`
	DELETE string `cfg:"delete"`
}

func (*Method) Value

func (m *Method) Value(method string) (string, error)

type OpenFGACheck

type OpenFGACheck struct {
	OpenFGACheckAPI string    `cfg:"openfga_check_api"`
	OpenFGAUserAPI  string    `cfg:"openfga_user_api"`
	OpenFGAModelID  string    `cfg:"openfga_model_id"`
	Operation       Operation `cfg:"operation"`

	InsecureSkipVerify bool `cfg:"insecure_skip_verify"`
	// contains filtered or unexported fields
}

func (*OpenFGACheck) Middleware

func (m *OpenFGACheck) Middleware(_ context.Context, _ string) (echo.MiddlewareFunc, error)

type Operation

type Operation struct {
	Parse Parse `cfg:"parse"`
}

type Parse

type Parse struct {
	// Enable to enable the Parse check.
	Enable bool `cfg:"enable"`
	// APINameRgx to extract name of the api.
	APINameRgx         string `cfg:"api_name_rgx"`
	APINameReplacement string `cfg:"api_name_replacement"`
	ObjectName         string `cfg:"object_name"`
	// Method match with relation.
	Method Method `cfg:"method"`
	// DefaultUserClaim claim to extract user alias from token.
	DefaultUserClaim  string            `cfg:"default_user_claim"`
	ProviderUserClaim map[string]string `cfg:"provider_user_claim"`
}

type TupleKey

type TupleKey struct {
	User     string `json:"user"`
	Relation string `json:"relation"`
	Object   string `json:"object"`
}

type UserResponse

type UserResponse struct {
	ID string `json:"id"`
}

Jump to

Keyboard shortcuts

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