acl

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 2 Imported by: 1 module, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

Index

Constants

View Source
const (
	ResourceType = "oic.r.acl2"
	ResourceURI  = "/oic/sec/acl2"
)

Variables

View Source
var AllResources = []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"`
	Tag        string        `json:"tag,omitempty"`
	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