blob: 51bc01ce2fb419b85c8c8a6268c595889ebd0ab9 [file] [log] [blame]
// Package acl defines types and methods to represent Access Control Lists and enforce authorization policies based on them.
package acl
import "veyron.io/veyron/veyron2/security"
// ACL represents an Access Control List - a set of blessings that should be
// granted access.
type ACL struct {
// In denotes the set of blessings (represented as BlessingPatterns) that
// should be granted access, unless blacklisted by an entry in NotIn.
//
// For example:
// In: {"alice/family/..."}
// grants access to a principal that presents at least one of "alice",
// "alice/family", "alice/family/friend" etc. as a blessing.
In []security.BlessingPattern
// NotIn denotes the set of blessings (and their delegates) that
// have been explicitly blacklisted from the In set.
//
// For example:
// In: {"alice/friend/..."}, NotIn: {"alice/friend/bob"}
// grants access to principals that present "alice", "alice/friend",
// "alice/friend/carol" etc. but NOT to a principal that presents
// "alice/friend/bob" or "alice/friend/bob/spouse" etc.
NotIn []string
// TODO(ashankar,ataly): At some point, introduce group identifiers here?
}
// TaggedACLMap maps string tags to access control lists specifying the
// blessings required to invoke methods with that tag.
//
// These tags are meant to add a layer of interposition between set of users
// (blessings, specifically) and the set of methods, much like "Roles" do in
// Role Based Access Control (RBAC).
// (http://en.wikipedia.org/wiki/Role-based_access_control)
type TaggedACLMap map[string]ACL