rest

package
v1.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ACLPolicyMedia = MediaType("application/jormungandr-acl-policy+json", func() {
	TypeName("ACLPolicy")
	Reference(ACLPolicyPayload)

	Attributes(func() {
		Attribute("id", String, "Policy ID")
		Attribute("description", String, "Policy description")
		Attribute("subjects", ArrayOf(String), "Subjects to match the request against.")
		Attribute("effect", String, "allow or deny")
		Attribute("resources", ArrayOf(String), "Resources to which this policy applies.")
		Attribute("actions", ArrayOf(String), "Actions to match the request against.")
		Attribute("conditions", ArrayOf(ConditionType), "Custom conditions")
		Attribute("owner", String, "Owner of the policy")

	})

	View("default", func() {
		Attribute("id", String, "Policy ID")
		Attribute("description", String, "Policy description")
		Attribute("subjects", ArrayOf(String), "Subjects to match the request against.")
		Attribute("effect", String, "allow or deny")
		Attribute("resources", ArrayOf(String), "Resources to which this policy applies.")
		Attribute("actions", ArrayOf(String), "Actions to match the request against.")
		Attribute("conditions", ArrayOf(ConditionType), "Custom conditions")
	})

})

ACLPolicyMedia defines the media type used to render ACLPolicy.

View Source
var ACLPolicyPayload = Type("ACLPolicyPayload", func() {
	Description("ACL Policy Payload")
	Attribute("id", String, "Policy ID")
	Attribute("description", String, "Description")
	Attribute("subjects", ArrayOf(String), "Subjects to match the request against.")
	Attribute("effect", String, "allow or deny")
	Attribute("resources", ArrayOf(String), "Resources to which this policy applies.")
	Attribute("actions", ArrayOf(String), "Actions to match the request against.")
	Attribute("conditions", ArrayOf(ConditionType), "Custom conditions")
	Required("resources", "effect", "subjects")
})

ACLPolicyPayload defines the payload for ACLPolicy.

View Source
var AccessPolicyPayload = Type("AccessPolicyPayload", func() {
	Description("Payload to allow or deny access to resources.")
	Attribute("description", String, "Description of the policy")
	Attribute("resources", ArrayOf(String), "Resources patterns")
	Attribute("users", ArrayOf(String), "Users patterns")
	Attribute("organizations", ArrayOf(String), "Organizations patterns")
	Attribute("allow", Boolean, "Whether to allow access")
	Attribute("scopes", ArrayOf(String), "Which scopes are allowed")
	Attribute("roles", ArrayOf(String), "Which roles are allowed")
	Required("resources", "allow")
})

AccessPolicyPayload defines the payload for AccessPolicy.

View Source
var ConditionType = Type("Condition", func() {
	Description("Custom ACL policy condition")
	Attribute("name", String, "Condition name")
	Attribute("type", String, "Condition type.")
	Attribute("patterns", ArrayOf(String), "Patterns to match the value against.")
	Required("name", "type", "patterns")
})

ConditionType defines the condition type.

Functions

This section is empty.

Types

type ACLController

type ACLController struct {
	*goa.Controller
	ladon.Manager
}

ACLController implements the acl resource.

func NewACLController

func NewACLController(service *goa.Service, manager ladon.Manager) (*ACLController, error)

NewACLController creates a acl controller.

func (*ACLController) CreatePolicy

func (c *ACLController) CreatePolicy(ctx *app.CreatePolicyAclContext) error

CreatePolicy runs the createPolicy action.

func (*ACLController) DeletePolicy

func (c *ACLController) DeletePolicy(ctx *app.DeletePolicyAclContext) error

DeletePolicy runs the deletePolicy action.

func (*ACLController) Get

func (c *ACLController) Get(ctx *app.GetAclContext) error

Get runs the get action.

func (*ACLController) ManageAccess

func (c *ACLController) ManageAccess(ctx *app.ManageAccessAclContext) error

ManageAccess runs the manage-access action.

func (*ACLController) UpdatePolicy

func (c *ACLController) UpdatePolicy(ctx *app.UpdatePolicyAclContext) error

UpdatePolicy runs the updatePolicy action.

Directories

Path Synopsis
app

Jump to

Keyboard shortcuts

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