app

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MountAclController

func MountAclController(service *goa.Service, ctrl AclController)

MountAclController "mounts" a Acl resource controller on the given service.

Types

type ACLPolicy

type ACLPolicy struct {
	// Actions to match the request against.
	Actions []string `form:"actions,omitempty" json:"actions,omitempty" xml:"actions,omitempty"`
	// Custom conditions
	Conditions []*Condition `form:"conditions,omitempty" json:"conditions,omitempty" xml:"conditions,omitempty"`
	// Policy description
	Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"`
	// allow or deny
	Effect *string `form:"effect,omitempty" json:"effect,omitempty" xml:"effect,omitempty"`
	// Policy ID
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Resources to which this policy applies.
	Resources []string `form:"resources,omitempty" json:"resources,omitempty" xml:"resources,omitempty"`
	// Subjects to match the request against.
	Subjects []string `form:"subjects,omitempty" json:"subjects,omitempty" xml:"subjects,omitempty"`
}

ACLPolicy media type (default view)

Identifier: application/jormungandr-acl-policy+json; view=default

func (*ACLPolicy) Validate

func (mt *ACLPolicy) Validate() (err error)

Validate validates the ACLPolicy media type instance.

type ACLPolicyPayload

type ACLPolicyPayload struct {
	// Actions to match the request against.
	Actions []string `form:"actions,omitempty" json:"actions,omitempty" xml:"actions,omitempty"`
	// Custom conditions
	Conditions []*Condition `form:"conditions,omitempty" json:"conditions,omitempty" xml:"conditions,omitempty"`
	// Description
	Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"`
	// allow or deny
	Effect string `form:"effect" json:"effect" xml:"effect"`
	// Policy ID
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Resources to which this policy applies.
	Resources []string `form:"resources" json:"resources" xml:"resources"`
	// Subjects to match the request against.
	Subjects []string `form:"subjects" json:"subjects" xml:"subjects"`
}

ACL Policy Payload

func (*ACLPolicyPayload) Validate

func (ut *ACLPolicyPayload) Validate() (err error)

Validate validates the ACLPolicyPayload type instance.

type AccessPolicyPayload

type AccessPolicyPayload struct {
	// Whether to allow access
	Allow bool `form:"allow" json:"allow" xml:"allow"`
	// Description of the policy
	Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"`
	// Organizations patterns
	Organizations []string `form:"organizations,omitempty" json:"organizations,omitempty" xml:"organizations,omitempty"`
	// Resources patterns
	Resources []string `form:"resources" json:"resources" xml:"resources"`
	// Which roles are allowed
	Roles []string `form:"roles,omitempty" json:"roles,omitempty" xml:"roles,omitempty"`
	// Which scopes are allowed
	Scopes []string `form:"scopes,omitempty" json:"scopes,omitempty" xml:"scopes,omitempty"`
	// Users patterns
	Users []string `form:"users,omitempty" json:"users,omitempty" xml:"users,omitempty"`
}

Payload to allow or deny access to resources.

func (*AccessPolicyPayload) Validate

func (ut *AccessPolicyPayload) Validate() (err error)

Validate validates the AccessPolicyPayload type instance.

type AclController

type AclController interface {
	goa.Muxer
	CreatePolicy(*CreatePolicyAclContext) error
	DeletePolicy(*DeletePolicyAclContext) error
	Get(*GetAclContext) error
	ManageAccess(*ManageAccessAclContext) error
	UpdatePolicy(*UpdatePolicyAclContext) error
}

AclController is the controller interface for the Acl actions.

type Condition

type Condition struct {
	// Condition name
	Name string `form:"name" json:"name" xml:"name"`
	// Patterns to match the value against.
	Patterns []string `form:"patterns" json:"patterns" xml:"patterns"`
	// Condition type.
	Type string `form:"type" json:"type" xml:"type"`
}

Custom ACL policy condition

func (*Condition) Validate

func (ut *Condition) Validate() (err error)

Validate validates the Condition type instance.

type CreatePolicyAclContext

type CreatePolicyAclContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *ACLPolicyPayload
}

CreatePolicyAclContext provides the acl createPolicy action context.

func NewCreatePolicyAclContext

func NewCreatePolicyAclContext(ctx context.Context, r *http.Request, service *goa.Service) (*CreatePolicyAclContext, error)

NewCreatePolicyAclContext parses the incoming request URL and body, performs validations and creates the context used by the acl controller createPolicy action.

func (*CreatePolicyAclContext) BadRequest

func (ctx *CreatePolicyAclContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (*CreatePolicyAclContext) Created

func (ctx *CreatePolicyAclContext) Created(r *ACLPolicy) error

Created sends a HTTP response with status code 201.

func (*CreatePolicyAclContext) InternalServerError

func (ctx *CreatePolicyAclContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

type DeletePolicyAclContext

type DeletePolicyAclContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	PolicyID string
}

DeletePolicyAclContext provides the acl deletePolicy action context.

func NewDeletePolicyAclContext

func NewDeletePolicyAclContext(ctx context.Context, r *http.Request, service *goa.Service) (*DeletePolicyAclContext, error)

NewDeletePolicyAclContext parses the incoming request URL and body, performs validations and creates the context used by the acl controller deletePolicy action.

func (*DeletePolicyAclContext) InternalServerError

func (ctx *DeletePolicyAclContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

func (*DeletePolicyAclContext) NotFound

func (ctx *DeletePolicyAclContext) NotFound(r error) error

NotFound sends a HTTP response with status code 404.

func (*DeletePolicyAclContext) OK

OK sends a HTTP response with status code 200.

type GetAclContext

type GetAclContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	PolicyID string
}

GetAclContext provides the acl get action context.

func NewGetAclContext

func NewGetAclContext(ctx context.Context, r *http.Request, service *goa.Service) (*GetAclContext, error)

NewGetAclContext parses the incoming request URL and body, performs validations and creates the context used by the acl controller get action.

func (*GetAclContext) InternalServerError

func (ctx *GetAclContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

func (*GetAclContext) NotFound

func (ctx *GetAclContext) NotFound(r error) error

NotFound sends a HTTP response with status code 404.

func (*GetAclContext) OK

func (ctx *GetAclContext) OK(r *ACLPolicy) error

OK sends a HTTP response with status code 200.

type ManageAccessAclContext

type ManageAccessAclContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *AccessPolicyPayload
}

ManageAccessAclContext provides the acl manage-access action context.

func NewManageAccessAclContext

func NewManageAccessAclContext(ctx context.Context, r *http.Request, service *goa.Service) (*ManageAccessAclContext, error)

NewManageAccessAclContext parses the incoming request URL and body, performs validations and creates the context used by the acl controller manage-access action.

func (*ManageAccessAclContext) BadRequest

func (ctx *ManageAccessAclContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (*ManageAccessAclContext) InternalServerError

func (ctx *ManageAccessAclContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

func (*ManageAccessAclContext) OK

OK sends a HTTP response with status code 200.

type UpdatePolicyAclContext

type UpdatePolicyAclContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	PolicyID string
	Payload  *ACLPolicyPayload
}

UpdatePolicyAclContext provides the acl updatePolicy action context.

func NewUpdatePolicyAclContext

func NewUpdatePolicyAclContext(ctx context.Context, r *http.Request, service *goa.Service) (*UpdatePolicyAclContext, error)

NewUpdatePolicyAclContext parses the incoming request URL and body, performs validations and creates the context used by the acl controller updatePolicy action.

func (*UpdatePolicyAclContext) BadRequest

func (ctx *UpdatePolicyAclContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (*UpdatePolicyAclContext) InternalServerError

func (ctx *UpdatePolicyAclContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

func (*UpdatePolicyAclContext) NotFound

func (ctx *UpdatePolicyAclContext) NotFound(r error) error

NotFound sends a HTTP response with status code 404.

func (*UpdatePolicyAclContext) OK

OK sends a HTTP response with status code 200.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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