bsql

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotations

type Annotations struct {
	EntitlementImmutable *connector_v2.EntitlementImmutable `yaml:"entitlement_immutable" json:"entitlement_immutable"`
	ExternalLink         *connector_v2.ExternalLink         `yaml:"external_link" json:"external_link"`
}

type AppTraitMapping

type AppTraitMapping struct {
	HelpUrl string            `yaml:"help_url" json:"help_url"`
	Profile map[string]string `yaml:"profile" json:"profile"`
}

type Config

type Config struct {
	AppName        string                  `yaml:"app_name" json:"app_name"`
	AppDescription string                  `yaml:"app_description" json:"app_description"`
	Connect        DatabaseConfig          `yaml:"connect" json:"connect"`
	ResourceTypes  map[string]ResourceType `yaml:"resource_types" json:"resource_types"`
}

func LoadConfigFromFile

func LoadConfigFromFile(path string) (*Config, error)

func Parse

func Parse(data []byte) (*Config, error)

func (Config) GetResourceType

func (c Config) GetResourceType(ctx context.Context, rtID string) (*v2.ResourceType, error)

func (Config) GetResourceTypes

func (c Config) GetResourceTypes(ctx context.Context) ([]*v2.ResourceType, error)

func (Config) GetSQLSyncers

func (c Config) GetSQLSyncers(ctx context.Context, db *sql.DB, dbEngine database.DbEngine, celEnv *bcel.Env) ([]connectorbuilder.ResourceSyncer, error)

type DatabaseConfig

type DatabaseConfig struct {
	DSN      string `yaml:"dsn" json:"dsn"` // DSN connection string
	User     string `yaml:"user" json:"user"`
	Password string `yaml:"password" json:"password"`
}

type EntitlementMapping

type EntitlementMapping struct {
	Id          string   `yaml:"id" json:"id"`
	DisplayName string   `yaml:"display_name" json:"display_name"`
	Description string   `yaml:"description" json:"description"`
	GrantableTo []string `yaml:"grantable_to" json:"grantable_to"`
	Purpose     string   `yaml:"purpose" json:"purpose"`
	Slug        string   `yaml:"slug" json:"slug"`
	Immutable   bool     `yaml:"immutable" json:"immutable"`
	SkipIf      string   `yaml:"skip_if" json:"skip_if"`
}

type EntitlementsQuery

type EntitlementsQuery struct {
	Query      string                `yaml:"query" json:"query"`
	Pagination *Pagination           `yaml:"pagination" json:"pagination"`
	Map        []*EntitlementMapping `yaml:"map" json:"map"`
}

type GrantMapping

type GrantMapping struct {
	SkipIf        string       `yaml:"skip_if" json:"skip_if"`
	PrincipalId   string       `yaml:"principal_id" json:"principal_id"`
	PrincipalType string       `yaml:"principal_type" json:"principal_type"`
	Entitlement   string       `yaml:"entitlement_id" json:"entitlement_id"`
	Annotations   *Annotations `yaml:"annotations" json:"annotations"`
}

type GrantsQuery

type GrantsQuery struct {
	Query      string          `yaml:"query" json:"query"`
	Pagination *Pagination     `yaml:"pagination" json:"pagination"`
	Map        []*GrantMapping `yaml:"map" json:"map"`
}

type GroupTraitMapping

type GroupTraitMapping struct {
	Profile map[string]string `yaml:"profile" json:"profile"`
}

type ListQuery

type ListQuery struct {
	Query      string           `yaml:"query" json:"query"`
	Pagination *Pagination      `yaml:"pagination" json:"pagination"`
	Map        *ResourceMapping `yaml:"map" json:"map"`
}

type Pagination

type Pagination struct {
	Strategy   string `yaml:"strategy" json:"strategy"` // "offset" or "cursor"
	PrimaryKey string `yaml:"primary_key,omitempty" json:"primary_key,omitempty"`
}

type ResourceMapping

type ResourceMapping struct {
	Id          string       `yaml:"id" json:"id"`
	DisplayName string       `yaml:"display_name" json:"display_name"`
	Description string       `yaml:"description" json:"description"`
	Traits      *Traits      `yaml:"traits" json:"traits"`
	Annotations *Annotations `yaml:"annotations" json:"annotations"`
}

type ResourceType

type ResourceType struct {
	Name                      string                `yaml:"name" json:"name"`
	List                      *ListQuery            `yaml:"list,omitempty" json:"list,omitempty"`
	Entitlements              *EntitlementsQuery    `yaml:"entitlements,omitempty" json:"entitlements,omitempty"`
	StaticEntitlements        []*EntitlementMapping `yaml:"static_entitlements,omitempty" json:"static_entitlements,omitempty"`
	Grants                    []*GrantsQuery        `yaml:"grants,omitempty" json:"grants,omitempty"`
	Description               string                `yaml:"description,omitempty" json:"description,omitempty"`
	SkipEntitlementsAndGrants bool                  `yaml:"skip_entitlements_and_grants,omitempty" json:"skip_entitlements_and_grants,omitempty"`
}

type RoleTraitMapping

type RoleTraitMapping struct {
	Profile map[string]string `yaml:"profile" json:"profile"`
}

type SQLSyncer

type SQLSyncer struct {
	// contains filtered or unexported fields
}

func (*SQLSyncer) Entitlements

func (s *SQLSyncer) Entitlements(ctx context.Context, resource *v2.Resource, pToken *pagination.Token) ([]*v2.Entitlement, string, annotations.Annotations, error)

func (*SQLSyncer) Grants

func (s *SQLSyncer) Grants(ctx context.Context, resource *v2.Resource, pToken *pagination.Token) ([]*v2.Grant, string, annotations.Annotations, error)

func (*SQLSyncer) List

func (s *SQLSyncer) List(ctx context.Context, parentResourceID *v2.ResourceId, pToken *pagination.Token) ([]*v2.Resource, string, annotations.Annotations, error)

func (*SQLSyncer) ResourceType

func (s *SQLSyncer) ResourceType(ctx context.Context) *v2.ResourceType

type Traits

type Traits struct {
	App   *AppTraitMapping   `yaml:"app" json:"app"`
	Group *GroupTraitMapping `yaml:"group" json:"group"`
	Role  *RoleTraitMapping  `yaml:"role" json:"role"`
	User  *UserTraitMapping  `yaml:"user" json:"user"`
}

type UserTraitMapping

type UserTraitMapping struct {
	Emails        []string          `yaml:"emails" json:"emails"`
	Status        string            `yaml:"status" json:"status"`
	StatusDetails string            `yaml:"status_details" json:"status_details"`
	Profile       map[string]string `yaml:"profile" json:"profile"`
	AccountType   string            `yaml:"account_type" json:"account_type"`
	Login         string            `yaml:"login" json:"login"`
	LoginAliases  []string          `yaml:"login_aliases" json:"login_aliases"`
	LastLogin     string            `yaml:"last_login" json:"last_login"`
	MfaEnabled    string            `yaml:"mfa_enabled" json:"mfa_enabled"`
	SsoEnabled    string            `yaml:"sso_enabled" json:"sso_enabled"`
}

Jump to

Keyboard shortcuts

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