Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions service/policy/db/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,7 @@ type PolicyDBClient struct {
*Queries
}

var (
TableAttributes = "attribute_definitions"
TableAttributeValues = "attribute_values"
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 Tables struct {
Attributes db.Table
AttributeValues 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
}

func NewClient(c *db.Client, logger *logger.Logger) PolicyDBClient {
t := db.NewTable(c.Schema())
Tables.Attributes = t(TableAttributes)
Tables.AttributeValues = t(TableAttributeValues)
Tables.Namespaces = t(TableNamespaces)
Tables.AttrFqn = t(TableAttrFqn)
Tables.AttributeKeyAccessGrants = t(TableAttributeKeyAccessGrants)
Tables.AttributeValueKeyAccessGrants = t(TableAttributeValueKeyAccessGrants)
Tables.ResourceMappings = t(TableResourceMappings)
Tables.SubjectMappings = t(TableSubjectMappings)
Tables.SubjectConditionSet = t(TableSubjectConditionSet)
Tables.KeyAccessServerRegistry = t(TableKeyAccessServerRegistry)

return PolicyDBClient{c, logger, New(c.Pgx)}
}

Expand Down
Loading