Documentation ¶
Index ¶
- Constants
- Variables
- func GetDBStateTypeTransformedEnum(state common.ActiveStateEnum) string
- type AttributeDefinition
- type AttributeDefinitionKeyAccessGrant
- type AttributeDefinitionRule
- type AttributeFqn
- type AttributeNamespace
- type AttributeValue
- type AttributeValueKeyAccessGrant
- type AttributeValueMember
- type CreateKeyAccessServerParams
- type DBTX
- type GetKeyAccessServerRow
- type KeyAccessServer
- type ListKeyAccessServersRow
- type NullAttributeDefinitionRule
- type PolicyDBClient
- func (c PolicyDBClient) AssignKeyAccessServerToAttribute(ctx context.Context, k *attributes.AttributeKeyAccessServer) (*attributes.AttributeKeyAccessServer, error)
- func (c PolicyDBClient) AssignKeyAccessServerToValue(ctx context.Context, k *attributes.ValueKeyAccessServer) (*attributes.ValueKeyAccessServer, error)
- func (c *PolicyDBClient) AttrFqnReindex() (res struct{ ... })
- func (c PolicyDBClient) CreateAttribute(ctx context.Context, r *attributes.CreateAttributeRequest) (*policy.Attribute, error)
- func (c PolicyDBClient) CreateAttributeValue(ctx context.Context, attributeID string, ...) (*policy.Value, error)
- func (c PolicyDBClient) CreateKeyAccessServer(ctx context.Context, r *kasregistry.CreateKeyAccessServerRequest) (*policy.KeyAccessServer, error)
- func (c PolicyDBClient) CreateNamespace(ctx context.Context, r *namespaces.CreateNamespaceRequest) (*policy.Namespace, error)
- func (c PolicyDBClient) CreateResourceMapping(ctx context.Context, r *resourcemapping.CreateResourceMappingRequest) (*policy.ResourceMapping, error)
- func (c PolicyDBClient) CreateSubjectConditionSet(ctx context.Context, s *subjectmapping.SubjectConditionSetCreate) (*policy.SubjectConditionSet, error)
- func (c PolicyDBClient) CreateSubjectMapping(ctx context.Context, s *subjectmapping.CreateSubjectMappingRequest) (*policy.SubjectMapping, error)
- func (c PolicyDBClient) DeactivateAttribute(ctx context.Context, id string) (*policy.Attribute, error)
- func (c PolicyDBClient) DeactivateAttributeValue(ctx context.Context, id string) (*policy.Value, error)
- func (c PolicyDBClient) DeactivateNamespace(ctx context.Context, id string) (*policy.Namespace, error)
- func (c PolicyDBClient) DeleteKeyAccessServer(ctx context.Context, id string) (*policy.KeyAccessServer, error)
- func (c PolicyDBClient) DeleteResourceMapping(ctx context.Context, id string) (*policy.ResourceMapping, error)
- func (c PolicyDBClient) DeleteSubjectConditionSet(ctx context.Context, id string) (*policy.SubjectConditionSet, error)
- func (c PolicyDBClient) DeleteSubjectMapping(ctx context.Context, id string) (*policy.SubjectMapping, error)
- func (c PolicyDBClient) GetAttribute(ctx context.Context, id string) (*policy.Attribute, error)
- func (c PolicyDBClient) GetAttributeByFqn(ctx context.Context, fqn string) (*policy.Attribute, error)
- func (c PolicyDBClient) GetAttributeValue(ctx context.Context, id string) (*policy.Value, error)
- func (c PolicyDBClient) GetAttributesByNamespace(ctx context.Context, namespaceID string) ([]*policy.Attribute, error)
- func (c *PolicyDBClient) GetAttributesByValueFqns(ctx context.Context, r *attributes.GetAttributeValuesByFqnsRequest) (map[string]*attributes.GetAttributeValuesByFqnsResponse_AttributeAndValue, ...)
- func (c PolicyDBClient) GetKeyAccessServer(ctx context.Context, id string) (*policy.KeyAccessServer, error)
- func (c PolicyDBClient) GetMatchedSubjectMappings(ctx context.Context, properties []*policy.SubjectProperty) ([]*policy.SubjectMapping, error)
- func (c PolicyDBClient) GetNamespace(ctx context.Context, id string) (*policy.Namespace, error)
- func (c PolicyDBClient) GetResourceMapping(ctx context.Context, id string) (*policy.ResourceMapping, error)
- func (c PolicyDBClient) GetSubjectConditionSet(ctx context.Context, id string) (*policy.SubjectConditionSet, error)
- func (c PolicyDBClient) GetSubjectMapping(ctx context.Context, id string) (*policy.SubjectMapping, error)
- func (c PolicyDBClient) ListAllAttributeValues(ctx context.Context, state string) ([]*policy.Value, error)
- func (c PolicyDBClient) ListAllAttributes(ctx context.Context, state string, namespace string) ([]*policy.Attribute, error)
- func (c PolicyDBClient) ListAllAttributesWithout(ctx context.Context, state string) ([]*policy.Attribute, error)
- func (c PolicyDBClient) ListAttributeValues(ctx context.Context, attributeID string, state string) ([]*policy.Value, error)
- func (c PolicyDBClient) ListKeyAccessServers(ctx context.Context) ([]*policy.KeyAccessServer, error)
- func (c PolicyDBClient) ListNamespaces(ctx context.Context, state string) ([]*policy.Namespace, error)
- func (c PolicyDBClient) ListResourceMappings(ctx context.Context) ([]*policy.ResourceMapping, error)
- func (c PolicyDBClient) ListSubjectConditionSets(ctx context.Context) ([]*policy.SubjectConditionSet, error)
- func (c PolicyDBClient) ListSubjectMappings(ctx context.Context) ([]*policy.SubjectMapping, error)
- func (c PolicyDBClient) RemoveKeyAccessServerFromAttribute(ctx context.Context, k *attributes.AttributeKeyAccessServer) (*attributes.AttributeKeyAccessServer, error)
- func (c PolicyDBClient) RemoveKeyAccessServerFromValue(ctx context.Context, k *attributes.ValueKeyAccessServer) (*attributes.ValueKeyAccessServer, error)
- func (c PolicyDBClient) UnsafeDeleteAttribute(ctx context.Context, existing *policy.Attribute, fqn string) (*policy.Attribute, error)
- func (c PolicyDBClient) UnsafeDeleteAttributeValue(ctx context.Context, toDelete *policy.Value, ...) (*policy.Value, error)
- func (c PolicyDBClient) UnsafeDeleteNamespace(ctx context.Context, existing *policy.Namespace, fqn string) (*policy.Namespace, error)
- func (c PolicyDBClient) UnsafeReactivateAttribute(ctx context.Context, id string) (*policy.Attribute, error)
- func (c PolicyDBClient) UnsafeReactivateAttributeValue(ctx context.Context, id string) (*policy.Value, error)
- func (c PolicyDBClient) UnsafeReactivateNamespace(ctx context.Context, id string) (*policy.Namespace, error)
- func (c PolicyDBClient) UnsafeUpdateAttribute(ctx context.Context, r *unsafe.UnsafeUpdateAttributeRequest) (*policy.Attribute, error)
- func (c PolicyDBClient) UnsafeUpdateAttributeValue(ctx context.Context, r *unsafe.UnsafeUpdateAttributeValueRequest) (*policy.Value, error)
- func (c PolicyDBClient) UnsafeUpdateNamespace(ctx context.Context, id string, name string) (*policy.Namespace, error)
- func (c PolicyDBClient) UpdateAttribute(ctx context.Context, id string, r *attributes.UpdateAttributeRequest) (*policy.Attribute, error)
- func (c PolicyDBClient) UpdateAttributeValue(ctx context.Context, r *attributes.UpdateAttributeValueRequest) (*policy.Value, error)
- func (c PolicyDBClient) UpdateKeyAccessServer(ctx context.Context, id string, r *kasregistry.UpdateKeyAccessServerRequest) (*policy.KeyAccessServer, error)
- func (c PolicyDBClient) UpdateNamespace(ctx context.Context, id string, r *namespaces.UpdateNamespaceRequest) (*policy.Namespace, error)
- func (c PolicyDBClient) UpdateResourceMapping(ctx context.Context, id string, ...) (*policy.ResourceMapping, error)
- func (c PolicyDBClient) UpdateSubjectConditionSet(ctx context.Context, r *subjectmapping.UpdateSubjectConditionSetRequest) (*policy.SubjectConditionSet, error)
- func (c PolicyDBClient) UpdateSubjectMapping(ctx context.Context, r *subjectmapping.UpdateSubjectMappingRequest) (*policy.SubjectMapping, error)
- type Queries
- func (q *Queries) CreateKeyAccessServer(ctx context.Context, arg CreateKeyAccessServerParams) (string, error)
- func (q *Queries) DeleteKeyAccessServer(ctx context.Context, id string) (int64, error)
- func (q *Queries) GetKeyAccessServer(ctx context.Context, id string) (GetKeyAccessServerRow, error)
- func (q *Queries) ListKeyAccessServers(ctx context.Context) ([]ListKeyAccessServersRow, error)
- func (q *Queries) UpdateKeyAccessServer(ctx context.Context, arg UpdateKeyAccessServerParams) (string, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type ResourceMapping
- type SubjectConditionSet
- type SubjectMapping
- type UpdateKeyAccessServerParams
Constants ¶
const ( StateInactive = "INACTIVE" StateActive = "ACTIVE" StateAny = "ANY" StateUnspecified = "UNSPECIFIED" )
Variables ¶
var ( TableAttributes = "attribute_definitions" TableAttributeValues = "attribute_values" TableValueMembers = "attribute_value_members" TableNamespaces = "attribute_namespaces" TableAttrFqn = "attribute_fqns" TableAttributeKeyAccessGrants = "attribute_definition_key_access_grants" TableAttributeValueKeyAccessGrants = "attribute_value_key_access_grants" TableResourceMappings = "resource_mappings" TableSubjectMappings = "subject_mappings" TableSubjectConditionSet = "subject_condition_set" TableKeyAccessServerRegistry = "key_access_servers" )
var AttributeRuleTypeEnumPrefix = "ATTRIBUTE_RULE_TYPE_ENUM_"
var Tables struct { Attributes db.Table AttributeValues db.Table ValueMembers db.Table Namespaces db.Table AttrFqn db.Table AttributeKeyAccessGrants db.Table AttributeValueKeyAccessGrants db.Table ResourceMappings db.Table SubjectMappings db.Table SubjectConditionSet db.Table KeyAccessServerRegistry db.Table }
Functions ¶
func GetDBStateTypeTransformedEnum ¶
func GetDBStateTypeTransformedEnum(state common.ActiveStateEnum) string
Types ¶
type AttributeDefinition ¶ added in v0.4.17
type AttributeDefinition struct { // Primary key for the table ID string `json:"id"` // Foreign key to the parent namespace of the attribute definition NamespaceID string `json:"namespace_id"` // Name of the attribute (i.e. organization or classification), unique within the namespace Name string `json:"name"` // Rule for the attribute (see protos for options) Rule AttributeDefinitionRule `json:"rule"` // Metadata for the attribute definition (see protos for structure) Metadata []byte `json:"metadata"` // Active/Inactive state Active bool `json:"active"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` // Order of value ids for the attribute (important for hierarchy rule) ValuesOrder []string `json:"values_order"` }
Table to store the definitions of attributes
type AttributeDefinitionKeyAccessGrant ¶ added in v0.4.17
type AttributeDefinitionKeyAccessGrant struct { // Foreign key to the attribute definition AttributeDefinitionID string `json:"attribute_definition_id"` // Foreign key to the KAS registration KeyAccessServerID string `json:"key_access_server_id"` }
Table to store the grants of key access servers (KASs) to attribute definitions
type AttributeDefinitionRule ¶ added in v0.4.17
type AttributeDefinitionRule string
const ( AttributeDefinitionRuleUNSPECIFIED AttributeDefinitionRule = "UNSPECIFIED" AttributeDefinitionRuleALLOF AttributeDefinitionRule = "ALL_OF" AttributeDefinitionRuleANYOF AttributeDefinitionRule = "ANY_OF" AttributeDefinitionRuleHIERARCHY AttributeDefinitionRule = "HIERARCHY" )
func (*AttributeDefinitionRule) Scan ¶ added in v0.4.17
func (e *AttributeDefinitionRule) Scan(src interface{}) error
type AttributeFqn ¶ added in v0.4.17
type AttributeFqn struct { // Primary key for the table ID string `json:"id"` // Foreign key to the namespace of the attribute NamespaceID pgtype.UUID `json:"namespace_id"` // Foreign key to the attribute definition AttributeID pgtype.UUID `json:"attribute_id"` // Foreign key to the attribute value ValueID pgtype.UUID `json:"value_id"` // Fully qualified name of the attribute (i.e. https://<namespace>/attr/<attribute name>/value/<value>) Fqn string `json:"fqn"` }
Table to store the fully qualified names of attributes for reverse lookup at their object IDs
type AttributeNamespace ¶ added in v0.4.17
type AttributeNamespace struct { // Primary key for the table ID string `json:"id"` // Name of the namespace (i.e. example.com) Name string `json:"name"` // Active/Inactive state Active bool `json:"active"` // Metadata for the namespace (see protos for structure) Metadata []byte `json:"metadata"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
Table to store the parent namespaces of platform policy attributes and related policy objects
type AttributeValue ¶ added in v0.4.17
type AttributeValue struct { // Primary key for the table ID string `json:"id"` // Foreign key to the parent attribute definition AttributeDefinitionID string `json:"attribute_definition_id"` // Value of the attribute (i.e. "manager" or "admin" on an attribute for titles), unique within the definition Value string `json:"value"` Members []string `json:"members"` // Metadata for the attribute value (see protos for structure) Metadata []byte `json:"metadata"` // Active/Inactive state Active bool `json:"active"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
Table to store the values of attributes
type AttributeValueKeyAccessGrant ¶ added in v0.4.17
type AttributeValueKeyAccessGrant struct { // Foreign key to the attribute value AttributeValueID string `json:"attribute_value_id"` // Foreign key to the KAS registration KeyAccessServerID string `json:"key_access_server_id"` }
Table to store the grants of key access servers (KASs) to attribute values
type AttributeValueMember ¶ added in v0.4.17
type CreateKeyAccessServerParams ¶ added in v0.4.17
type GetKeyAccessServerRow ¶ added in v0.4.17
type KeyAccessServer ¶ added in v0.4.17
type KeyAccessServer struct { // Primary key for the table ID string `json:"id"` // URI of the KAS Uri string `json:"uri"` // Public key of the KAS (see protos for structure/options) PublicKey []byte `json:"public_key"` // Metadata for the KAS (see protos for structure) Metadata []byte `json:"metadata"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
Table to store the known registrations of key access servers (KASs)
type ListKeyAccessServersRow ¶ added in v0.4.17
type NullAttributeDefinitionRule ¶ added in v0.4.17
type NullAttributeDefinitionRule struct { AttributeDefinitionRule AttributeDefinitionRule `json:"attribute_definition_rule"` Valid bool `json:"valid"` // Valid is true if AttributeDefinitionRule is not NULL }
func (*NullAttributeDefinitionRule) Scan ¶ added in v0.4.17
func (ns *NullAttributeDefinitionRule) Scan(value interface{}) error
Scan implements the Scanner interface.
type PolicyDBClient ¶
func (PolicyDBClient) AssignKeyAccessServerToAttribute ¶
func (c PolicyDBClient) AssignKeyAccessServerToAttribute(ctx context.Context, k *attributes.AttributeKeyAccessServer) (*attributes.AttributeKeyAccessServer, error)
func (PolicyDBClient) AssignKeyAccessServerToValue ¶
func (c PolicyDBClient) AssignKeyAccessServerToValue(ctx context.Context, k *attributes.ValueKeyAccessServer) (*attributes.ValueKeyAccessServer, error)
func (*PolicyDBClient) AttrFqnReindex ¶
func (c *PolicyDBClient) AttrFqnReindex() (res struct { Namespaces []struct { ID string Fqn string } Attributes []struct { ID string Fqn string } Values []struct { ID string Fqn string } }, )
AttrFqnReindex will reindex all namespace, attribute, and attribute_value FQNs
func (PolicyDBClient) CreateAttribute ¶
func (c PolicyDBClient) CreateAttribute(ctx context.Context, r *attributes.CreateAttributeRequest) (*policy.Attribute, error)
func (PolicyDBClient) CreateAttributeValue ¶
func (c PolicyDBClient) CreateAttributeValue(ctx context.Context, attributeID string, v *attributes.CreateAttributeValueRequest) (*policy.Value, error)
func (PolicyDBClient) CreateKeyAccessServer ¶ added in v0.2.0
func (c PolicyDBClient) CreateKeyAccessServer(ctx context.Context, r *kasregistry.CreateKeyAccessServerRequest) (*policy.KeyAccessServer, error)
func (PolicyDBClient) CreateNamespace ¶
func (c PolicyDBClient) CreateNamespace(ctx context.Context, r *namespaces.CreateNamespaceRequest) (*policy.Namespace, error)
func (PolicyDBClient) CreateResourceMapping ¶
func (c PolicyDBClient) CreateResourceMapping(ctx context.Context, r *resourcemapping.CreateResourceMappingRequest) (*policy.ResourceMapping, error)
func (PolicyDBClient) CreateSubjectConditionSet ¶
func (c PolicyDBClient) CreateSubjectConditionSet(ctx context.Context, s *subjectmapping.SubjectConditionSetCreate) (*policy.SubjectConditionSet, error)
Creates a new subject condition set and returns the id of the created
func (PolicyDBClient) CreateSubjectMapping ¶
func (c PolicyDBClient) CreateSubjectMapping(ctx context.Context, s *subjectmapping.CreateSubjectMappingRequest) (*policy.SubjectMapping, error)
Creates a new subject mapping and returns the id of the created. If an existing subject condition set id is provided, it will be used. If a new subject condition set is provided, it will be created. The existing subject condition set id takes precedence.
func (PolicyDBClient) DeactivateAttribute ¶
func (PolicyDBClient) DeactivateAttributeValue ¶
func (PolicyDBClient) DeactivateNamespace ¶
func (PolicyDBClient) DeleteKeyAccessServer ¶ added in v0.2.0
func (c PolicyDBClient) DeleteKeyAccessServer(ctx context.Context, id string) (*policy.KeyAccessServer, error)
func (PolicyDBClient) DeleteResourceMapping ¶
func (c PolicyDBClient) DeleteResourceMapping(ctx context.Context, id string) (*policy.ResourceMapping, error)
func (PolicyDBClient) DeleteSubjectConditionSet ¶
func (c PolicyDBClient) DeleteSubjectConditionSet(ctx context.Context, id string) (*policy.SubjectConditionSet, error)
Deletes specified subject condition set and returns the id of the deleted
func (PolicyDBClient) DeleteSubjectMapping ¶
func (c PolicyDBClient) DeleteSubjectMapping(ctx context.Context, id string) (*policy.SubjectMapping, error)
Deletes specified subject mapping and returns the id of the deleted
func (PolicyDBClient) GetAttribute ¶
func (PolicyDBClient) GetAttributeByFqn ¶
func (PolicyDBClient) GetAttributeValue ¶
func (PolicyDBClient) GetAttributesByNamespace ¶
func (*PolicyDBClient) GetAttributesByValueFqns ¶
func (c *PolicyDBClient) GetAttributesByValueFqns(ctx context.Context, r *attributes.GetAttributeValuesByFqnsRequest) (map[string]*attributes.GetAttributeValuesByFqnsResponse_AttributeAndValue, error)
func (PolicyDBClient) GetKeyAccessServer ¶ added in v0.2.0
func (c PolicyDBClient) GetKeyAccessServer(ctx context.Context, id string) (*policy.KeyAccessServer, error)
func (PolicyDBClient) GetMatchedSubjectMappings ¶
func (c PolicyDBClient) GetMatchedSubjectMappings(ctx context.Context, properties []*policy.SubjectProperty) ([]*policy.SubjectMapping, error)
GetMatchedSubjectMappings liberally returns a list of SubjectMappings based on the provided SubjectProperties. The SubjectMappings are returned if there is any single condition found among the structures that matches: 1. The external field, external value, and an IN operator 2. The external field, _no_ external value, and a NOT_IN operator
Without this filtering, if a field was something like '.emailAddress' or '.username', every Subject is probably going to relate to that mapping in some way or another, potentially matching every single attribute in the DB if a policy admin has relied heavily on that field. There is no logic applied beyond a single condition within the query to avoid business logic interpreting the supplied conditions beyond the bare minimum initial filter.
NOTE: This relationship is sometimes called Entitlements or Subject Entitlements. NOTE: if you have any issues, set the log level to 'debug' for more comprehensive context.
func (PolicyDBClient) GetNamespace ¶
func (PolicyDBClient) GetResourceMapping ¶
func (c PolicyDBClient) GetResourceMapping(ctx context.Context, id string) (*policy.ResourceMapping, error)
func (PolicyDBClient) GetSubjectConditionSet ¶
func (c PolicyDBClient) GetSubjectConditionSet(ctx context.Context, id string) (*policy.SubjectConditionSet, error)
func (PolicyDBClient) GetSubjectMapping ¶
func (c PolicyDBClient) GetSubjectMapping(ctx context.Context, id string) (*policy.SubjectMapping, error)
func (PolicyDBClient) ListAllAttributeValues ¶
func (PolicyDBClient) ListAllAttributes ¶
func (PolicyDBClient) ListAllAttributesWithout ¶
func (PolicyDBClient) ListAttributeValues ¶
func (PolicyDBClient) ListKeyAccessServers ¶ added in v0.2.0
func (c PolicyDBClient) ListKeyAccessServers(ctx context.Context) ([]*policy.KeyAccessServer, error)
func (PolicyDBClient) ListNamespaces ¶
func (PolicyDBClient) ListResourceMappings ¶
func (c PolicyDBClient) ListResourceMappings(ctx context.Context) ([]*policy.ResourceMapping, error)
func (PolicyDBClient) ListSubjectConditionSets ¶
func (c PolicyDBClient) ListSubjectConditionSets(ctx context.Context) ([]*policy.SubjectConditionSet, error)
func (PolicyDBClient) ListSubjectMappings ¶
func (c PolicyDBClient) ListSubjectMappings(ctx context.Context) ([]*policy.SubjectMapping, error)
func (PolicyDBClient) RemoveKeyAccessServerFromAttribute ¶
func (c PolicyDBClient) RemoveKeyAccessServerFromAttribute(ctx context.Context, k *attributes.AttributeKeyAccessServer) (*attributes.AttributeKeyAccessServer, error)
func (PolicyDBClient) RemoveKeyAccessServerFromValue ¶
func (c PolicyDBClient) RemoveKeyAccessServerFromValue(ctx context.Context, k *attributes.ValueKeyAccessServer) (*attributes.ValueKeyAccessServer, error)
func (PolicyDBClient) UnsafeDeleteAttribute ¶ added in v0.4.8
func (PolicyDBClient) UnsafeDeleteAttributeValue ¶ added in v0.4.8
func (c PolicyDBClient) UnsafeDeleteAttributeValue(ctx context.Context, toDelete *policy.Value, r *unsafe.UnsafeDeleteAttributeValueRequest) (*policy.Value, error)
func (PolicyDBClient) UnsafeDeleteNamespace ¶ added in v0.4.7
func (PolicyDBClient) UnsafeReactivateAttribute ¶ added in v0.4.8
func (PolicyDBClient) UnsafeReactivateAttributeValue ¶ added in v0.4.8
func (PolicyDBClient) UnsafeReactivateNamespace ¶ added in v0.4.7
func (PolicyDBClient) UnsafeUpdateAttribute ¶ added in v0.4.8
func (c PolicyDBClient) UnsafeUpdateAttribute(ctx context.Context, r *unsafe.UnsafeUpdateAttributeRequest) (*policy.Attribute, error)
func (PolicyDBClient) UnsafeUpdateAttributeValue ¶ added in v0.4.8
func (c PolicyDBClient) UnsafeUpdateAttributeValue(ctx context.Context, r *unsafe.UnsafeUpdateAttributeValueRequest) (*policy.Value, error)
func (PolicyDBClient) UnsafeUpdateNamespace ¶ added in v0.4.7
func (PolicyDBClient) UpdateAttribute ¶
func (c PolicyDBClient) UpdateAttribute(ctx context.Context, id string, r *attributes.UpdateAttributeRequest) (*policy.Attribute, error)
func (PolicyDBClient) UpdateAttributeValue ¶
func (c PolicyDBClient) UpdateAttributeValue(ctx context.Context, r *attributes.UpdateAttributeValueRequest) (*policy.Value, error)
func (PolicyDBClient) UpdateKeyAccessServer ¶ added in v0.2.0
func (c PolicyDBClient) UpdateKeyAccessServer(ctx context.Context, id string, r *kasregistry.UpdateKeyAccessServerRequest) (*policy.KeyAccessServer, error)
func (PolicyDBClient) UpdateNamespace ¶
func (c PolicyDBClient) UpdateNamespace(ctx context.Context, id string, r *namespaces.UpdateNamespaceRequest) (*policy.Namespace, error)
func (PolicyDBClient) UpdateResourceMapping ¶
func (c PolicyDBClient) UpdateResourceMapping(ctx context.Context, id string, r *resourcemapping.UpdateResourceMappingRequest) (*policy.ResourceMapping, error)
func (PolicyDBClient) UpdateSubjectConditionSet ¶
func (c PolicyDBClient) UpdateSubjectConditionSet(ctx context.Context, r *subjectmapping.UpdateSubjectConditionSetRequest) (*policy.SubjectConditionSet, error)
Mutates provided fields and returns id of the updated subject condition set
func (PolicyDBClient) UpdateSubjectMapping ¶
func (c PolicyDBClient) UpdateSubjectMapping(ctx context.Context, r *subjectmapping.UpdateSubjectMappingRequest) (*policy.SubjectMapping, error)
Mutates provided fields and returns id of the updated subject mapping
type Queries ¶ added in v0.4.17
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateKeyAccessServer ¶ added in v0.4.17
func (q *Queries) CreateKeyAccessServer(ctx context.Context, arg CreateKeyAccessServerParams) (string, error)
CreateKeyAccessServer
INSERT INTO key_access_servers (uri, public_key, metadata) VALUES ($1, $2, $3) RETURNING id
func (*Queries) DeleteKeyAccessServer ¶ added in v0.4.17
DeleteKeyAccessServer
DELETE FROM key_access_servers WHERE id = $1
func (*Queries) GetKeyAccessServer ¶ added in v0.4.17
GetKeyAccessServer
SELECT id, uri, public_key, JSON_STRIP_NULLS(JSON_BUILD_OBJECT('labels', metadata -> 'labels', 'created_at', created_at, 'updated_at', updated_at)) as metadata FROM key_access_servers WHERE id = $1
func (*Queries) ListKeyAccessServers ¶ added in v0.4.17
func (q *Queries) ListKeyAccessServers(ctx context.Context) ([]ListKeyAccessServersRow, error)
KEY ACCESS SERVERS
SELECT id, uri, public_key, JSON_STRIP_NULLS(JSON_BUILD_OBJECT('labels', metadata -> 'labels', 'created_at', created_at, 'updated_at', updated_at)) as metadata FROM key_access_servers
func (*Queries) UpdateKeyAccessServer ¶ added in v0.4.17
func (q *Queries) UpdateKeyAccessServer(ctx context.Context, arg UpdateKeyAccessServerParams) (string, error)
UpdateKeyAccessServer
UPDATE key_access_servers SET uri = coalesce($2, uri), public_key = coalesce($3, public_key), metadata = coalesce($4, metadata) WHERE id = $1 RETURNING id
type ResourceMapping ¶ added in v0.4.17
type ResourceMapping struct { // Primary key for the table ID string `json:"id"` // Foreign key to the attribute value AttributeValueID string `json:"attribute_value_id"` // Terms to match against resource data (i.e. translations "roi", "rey", or "kung" in a terms list could map to the value "/attr/card/value/king") Terms []string `json:"terms"` // Metadata for the resource mapping (see protos for structure) Metadata []byte `json:"metadata"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
Table to store associated terms that should map resource data to attribute values
type SubjectConditionSet ¶ added in v0.4.17
type SubjectConditionSet struct { // Primary key for the table ID string `json:"id"` // Conditions that must be met for the subject entity to be entitled to the attribute value (see protos for JSON structure) Condition []byte `json:"condition"` // Metadata for the condition set (see protos for structure) Metadata []byte `json:"metadata"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` }
Table to store sets of conditions that logically entitle subject entity representations to attribute values via a subject mapping
type SubjectMapping ¶ added in v0.4.17
type SubjectMapping struct { // Primary key for the table ID string `json:"id"` // Foreign key to the attribute value AttributeValueID string `json:"attribute_value_id"` // Metadata for the subject mapping (see protos for structure) Metadata []byte `json:"metadata"` CreatedAt pgtype.Timestamptz `json:"created_at"` UpdatedAt pgtype.Timestamptz `json:"updated_at"` // Foreign key to the condition set that entitles the subject entity to the attribute value SubjectConditionSetID pgtype.UUID `json:"subject_condition_set_id"` // Actions that the subject entity can perform on the attribute value (see protos for details) Actions []byte `json:"actions"` }
Table to store conditions that logically entitle subject entity representations to attribute values