acl

package
v0.0.0-...-d974290 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Access Control List https://github.com/openconnectivityfoundation/security/blob/master/swagger2.0/oic.sec.acl2.swagger.json

Index

Constants

This section is empty.

Variables

View Source
var AllResources = []Resource{Resource{
	Interfaces: []string{"*"},
	Wildcard:   ResourceWildcard_NONCFG_ALL,
}}

Functions

This section is empty.

Types

type AccessControl

type AccessControl struct {
	ID         int           `json:"id,omitempty"`
	Permission Permission    `json:"permission"`
	Resources  []Resource    `json:"resources"`
	Subject    Subject       `json:"subject"`
	Validity   []TimePattern `json:"validity,omitempty"`
}

type ConnectionType

type ConnectionType string
const (
	// authenticated encrypted connection
	ConnectionType_AUTH_CRYPT ConnectionType = "auth-crypt"
	// anonymous clear-text connection
	ConnectionType_ANON_CLEAR ConnectionType = "anon-clear"
)

type Permission

type Permission int
const (
	Permission_CREATE Permission = 1
	Permission_READ   Permission = 2
	Permission_WRITE  Permission = 4
	Permission_DELETE Permission = 8
	Permission_NOTIFY Permission = 16

	AllPermissions = Permission_CREATE | Permission_READ | Permission_WRITE | Permission_DELETE | Permission_NOTIFY
)

func (Permission) Has

func (b Permission) Has(flag Permission) bool

Has returns true if the flag is set.

func (Permission) String

func (s Permission) String() string

type Resource

type Resource struct {
	Href          string           `json:"href,omitempty"`
	Interfaces    []string         `json:"if,omitempty"`
	ResourceTypes []string         `json:"rt,omitempty"`
	Wildcard      ResourceWildcard `json:"wc,omitempty"`
}

type ResourceWildcard

type ResourceWildcard string
const (
	ResourceWildcard_NONCFG_SEC_ENDPOINT    ResourceWildcard = "+"
	ResourceWildcard_NONCFG_NONSEC_ENDPOINT ResourceWildcard = "-"
	ResourceWildcard_NONCFG_ALL             ResourceWildcard = "*"
)

type Response

type Response struct {
	ResourceOwner     string          `json:"rowneruuid"`
	Interfaces        []string        `json:"if"`
	ResourceTypes     []string        `json:"rt"`
	Name              string          `json:"n"`
	AccessControlList []AccessControl `json:"aclist2"`
}

type Subject

type Subject struct {
	*Subject_Device
	*Subject_Role
	*Subject_Connection
}

anyof/oneof

type Subject_Connection

type Subject_Connection struct {
	Type ConnectionType `json:"conntype,omitempty"`
}

type Subject_Device

type Subject_Device struct {
	DeviceID string `json:"uuid,omitempty"`
}

type Subject_Role

type Subject_Role struct {
	Authority string `json:"authority,omitempty"`
	Role      string `json:"role,omitempty"`
}

type TimePattern

type TimePattern struct {
	Period     string `json:"period"`
	Recurrence string `json:"recurrence"`
}

type UpdateRequest

type UpdateRequest struct {
	ResourceOwner     string          `json:"rowneruuid,omitempty"`
	AccessControlList []AccessControl `json:"aclist2"`
}

Jump to

Keyboard shortcuts

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