ladon

package
v0.3.1-sandbox Latest Latest
Warning

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

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

Documentation

Overview

Package ladon

Index

Constants

View Source
const (
	Allow = "allow"
	Deny  = "deny"
)
View Source
const (
	BasePath = "/engines/acp/ory/:flavor"
)

Variables

View Source
var EnabledFlavors = []string{"exact", "glob", "regex"}

Functions

func RoutesToObserve

func RoutesToObserve() []string

Types

type Context

type Context map[string]interface{}

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

swagger:ignore

func NewEngine

func NewEngine(store kstorage.Manager, sh *kstorage.Handler, e *engine.Engine, h herodot.Writer) *Engine

func (*Engine) Register

func (e *Engine) Register(r *httprouter.Router)

type Input

type Input struct {
	// Resource is the resource that access is requested to.
	Resource string `json:"resource"`

	// Action is the action that is requested on the resource.
	Action string `json:"action"`

	// Subject is the subject that is requesting access.
	Subject string `json:"subject"`

	// Context is the request's environmental context.
	Context map[string]interface{} `json:"context"`
}

Input for checking if a request is allowed or not.

swagger:ignore

type Policies

type Policies []Policy

Policies is an array of policies.

swagger:ignore

type Policy

type Policy struct {
	// ID is the unique identifier of the ORY Access Policy. It is used to query, update, and remove the ORY Access Policy.
	ID string `json:"id"`

	// Description is an optional, human-readable description.
	Description string `json:"description"`

	// Subjects is an array representing all the subjects this ORY Access Policy applies to.
	Subjects []string `json:"subjects"`

	// Resources is an array representing all the resources this ORY Access Policy applies to.
	Resources []string `json:"resources"`

	// Actions is an array representing all the actions this ORY Access Policy applies to.
	Actions []string `json:"actions"`

	// Effect is the effect of this ORY Access Policy. It can be "allow" or "deny".
	Effect string `json:"effect"`

	// Conditions represents a keyed object of conditions under which this ORY Access Policy is active.
	Conditions map[string]interface{} `json:"conditions"`
}

Policy specifies an ORY Access Policy document.

swagger:ignore

type Role

type Role struct {
	// ID is the role's unique id.
	ID string `json:"id"`

	// Members is who belongs to the role.
	Members []string `json:"members"`
}

Role represents a group of users that share the same role. A role could be an administrator, a moderator, a regular user or some other sort of role.

swagger:ignore

type Roles

type Roles []Role

A list of roles.

swagger:ignore

Directories

Path Synopsis
Package rego is a placeholder package to force download this package and its subpackages when we run `go mod vendor`
Package rego is a placeholder package to force download this package and its subpackages when we run `go mod vendor`
condition
Package condition is placeholder package to force download this package when we run `go mod vendor`
Package condition is placeholder package to force download this package when we run `go mod vendor`
core
Package core is placeholder package to force download this package when we run `go mod vendor`
Package core is placeholder package to force download this package when we run `go mod vendor`
exact
Package exact is placeholder package to force download this package when we run `go mod vendor`
Package exact is placeholder package to force download this package when we run `go mod vendor`
glob
Package exact is placeholder package to force download this package when we run `go mod vendor`
Package exact is placeholder package to force download this package when we run `go mod vendor`
regex
Package regex is placeholder package to force download this package when we run `go mod vendor`
Package regex is placeholder package to force download this package when we run `go mod vendor`

Jump to

Keyboard shortcuts

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