db

package
v0.0.0-...-2921379 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AFWUpdateStateParams

type AFWUpdateStateParams struct {
	ID   string      `json:"id"`
	Name null.String `json:"name"`
}

type AFWUpdateTenantParams

type AFWUpdateTenantParams struct {
	ID              string      `json:"id"`
	AfwEnterpriseID null.String `json:"afw_enterprise_id"`
}

type AddDeviceToGroupParams

type AddDeviceToGroupParams struct {
	GroupID  string `json:"group_id"`
	DeviceID string `json:"device_id"`
}

type AddDomainToTenantParams

type AddDomainToTenantParams struct {
	TenantID string `json:"tenant_id"`
	Domain   string `json:"domain"`
}

type AddPolicyToGroupParams

type AddPolicyToGroupParams struct {
	GroupID  string `json:"group_id"`
	PolicyID string `json:"policy_id"`
}

type AndroidForWorkEnrollmentState

type AndroidForWorkEnrollmentState struct {
	ID        string      `json:"id"`
	Name      null.String `json:"name"`
	CreatedAt time.Time   `json:"created_at"`
}

type Application

type Application struct {
	ID          string      `json:"id"`
	TenantID    string      `json:"tenant_id"`
	Name        null.String `json:"name"`
	Description null.String `json:"description"`
	Publisher   null.String `json:"publisher"`
}

type ApplicationTarget

type ApplicationTarget struct {
	AppID    string      `json:"app_id"`
	TenantID string      `json:"tenant_id"`
	MsiFile  null.String `json:"msi_file"`
	StoreID  null.String `json:"store_id"`
}

type Certificate

type Certificate struct {
	ID   string `json:"id"`
	Cert []byte `json:"cert"`
	Key  []byte `json:"key"`
}

type CreateDeviceParams

type CreateDeviceParams struct {
	TenantID          string             `json:"tenant_id"`
	Protocol          ManagementProtocol `json:"protocol"`
	Scope             ManagementScope    `json:"scope"`
	State             DeviceState        `json:"state"`
	Udid              string             `json:"udid"`
	Name              null.String        `json:"name"`
	SerialNumber      null.String        `json:"serial_number"`
	ModelManufacturer null.String        `json:"model_manufacturer"`
	Model             null.String        `json:"model"`
	OsMajor           null.String        `json:"os_major"`
	OsMinor           null.String        `json:"os_minor"`
	Owner             null.String        `json:"owner"`
	Ownership         DeviceOwnership    `json:"ownership"`
	AzureDid          null.String        `json:"azure_did"`
}

type CreateObjectParams

type CreateObjectParams struct {
	TenantID string      `json:"tenant_id"`
	Filename null.String `json:"filename"`
	Data     []byte      `json:"data"`
}

type CreateRawCertParams

type CreateRawCertParams struct {
	ID   string `json:"id"`
	Cert []byte `json:"cert"`
	Key  []byte `json:"key"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteApplicationParams

type DeleteApplicationParams struct {
	ID       string `json:"id"`
	TenantID string `json:"tenant_id"`
}

type DeleteDomainParams

type DeleteDomainParams struct {
	Domain   string `json:"domain"`
	TenantID string `json:"tenant_id"`
}

type DeleteGroupParams

type DeleteGroupParams struct {
	ID       string `json:"id"`
	TenantID string `json:"tenant_id"`
}

type DeletePolicyParams

type DeletePolicyParams struct {
	ID       string `json:"id"`
	TenantID string `json:"tenant_id"`
}

type DeleteUserInTenantParams

type DeleteUserInTenantParams struct {
	UPN      string      `json:"upn"`
	TenantID null.String `json:"tenant_id"`
}

type Device

type Device struct {
	ID                string             `json:"id"`
	TenantID          string             `json:"tenant_id"`
	Protocol          ManagementProtocol `json:"protocol"`
	Scope             ManagementScope    `json:"scope"`
	State             DeviceState        `json:"state"`
	Udid              string             `json:"udid"`
	Name              null.String        `json:"name"`
	Description       null.String        `json:"description"`
	SerialNumber      null.String        `json:"serial_number"`
	ModelManufacturer null.String        `json:"model_manufacturer"`
	Model             null.String        `json:"model"`
	OsMajor           null.String        `json:"os_major"`
	OsMinor           null.String        `json:"os_minor"`
	Owner             null.String        `json:"owner"`
	Ownership         DeviceOwnership    `json:"ownership"`
	AzureDid          null.String        `json:"azure_did"`
	Lastseen          sql.NullTime       `json:"lastseen"`
	EnrolledAt        time.Time          `json:"enrolled_at"`
}

type DeviceOwnership

type DeviceOwnership string
const (
	DeviceOwnershipCorporate DeviceOwnership = "corporate"
	DeviceOwnershipPersonal  DeviceOwnership = "personal"
)

func (*DeviceOwnership) Scan

func (e *DeviceOwnership) Scan(src interface{}) error

type DeviceState

type DeviceState string
const (
	DeviceStateDeploying      DeviceState = "deploying"
	DeviceStateManaged        DeviceState = "managed"
	DeviceStateUserUnenrolled DeviceState = "user_unenrolled"
	DeviceStateDisabled       DeviceState = "disabled"
	DeviceStateMissing        DeviceState = "missing"
)

func (*DeviceState) Scan

func (e *DeviceState) Scan(src interface{}) error

type EventLog

type EventLog struct {
	EventID       int32           `json:"event_id"`
	TableName     string          `json:"table_name"`
	ResourceID    null.String     `json:"resource_id"`
	TenantID      null.String     `json:"tenant_id"`
	UserUpn       null.String     `json:"user_upn"`
	Time          time.Time       `json:"time"`
	Operation     Operation       `json:"operation"`
	ExistingValue json.RawMessage `json:"existing_value"`
}

type GetApplicationParams

type GetApplicationParams struct {
	ID       string `json:"id"`
	TenantID string `json:"tenant_id"`
}

type GetApplicationRow

type GetApplicationRow struct {
	Name        null.String `json:"name"`
	Description null.String `json:"description"`
	Publisher   null.String `json:"publisher"`
}

type GetApplicationTargetsParams

type GetApplicationTargetsParams struct {
	AppID    string `json:"app_id"`
	TenantID string `json:"tenant_id"`
}

type GetApplicationTargetsRow

type GetApplicationTargetsRow struct {
	MsiFile null.String `json:"msi_file"`
	StoreID null.String `json:"store_id"`
}

type GetApplicationsParams

type GetApplicationsParams struct {
	TenantID string `json:"tenant_id"`
	Limit    int32  `json:"limit"`
	Offset   int32  `json:"offset"`
}

type GetApplicationsRow

type GetApplicationsRow struct {
	ID        string      `json:"id"`
	Name      null.String `json:"name"`
	Publisher null.String `json:"publisher"`
}

type GetDeviceForManagementRow

type GetDeviceForManagementRow struct {
	ID                string             `json:"id"`
	TenantID          string             `json:"tenant_id"`
	Protocol          ManagementProtocol `json:"protocol"`
	Scope             ManagementScope    `json:"scope"`
	State             DeviceState        `json:"state"`
	Name              null.String        `json:"name"`
	SerialNumber      null.String        `json:"serial_number"`
	ModelManufacturer null.String        `json:"model_manufacturer"`
	Model             null.String        `json:"model"`
	OsMajor           null.String        `json:"os_major"`
	OsMinor           null.String        `json:"os_minor"`
	Owner             null.String        `json:"owner"`
	Ownership         DeviceOwnership    `json:"ownership"`
	AzureDid          null.String        `json:"azure_did"`
}

type GetDeviceGroupsParams

type GetDeviceGroupsParams struct {
	DeviceID string `json:"device_id"`
	TenantID string `json:"tenant_id"`
}

type GetDeviceGroupsRow

type GetDeviceGroupsRow struct {
	ID   string      `json:"id"`
	Name null.String `json:"name"`
}

type GetDeviceParams

type GetDeviceParams struct {
	ID       string `json:"id"`
	TenantID string `json:"tenant_id"`
}

type GetDevicePoliciesRow

type GetDevicePoliciesRow struct {
	ID          string      `json:"id"`
	Name        null.String `json:"name"`
	Description null.String `json:"description"`
	PolicyID    string      `json:"policy_id"`
	GroupID     string      `json:"group_id"`
}

type GetDeviceRow

type GetDeviceRow struct {
	ID                string             `json:"id"`
	Protocol          ManagementProtocol `json:"protocol"`
	Scope             ManagementScope    `json:"scope"`
	State             DeviceState        `json:"state"`
	Name              null.String        `json:"name"`
	SerialNumber      null.String        `json:"serial_number"`
	ModelManufacturer null.String        `json:"model_manufacturer"`
	Model             null.String        `json:"model"`
	OsMajor           null.String        `json:"os_major"`
	OsMinor           null.String        `json:"os_minor"`
	Owner             null.String        `json:"owner"`
	Ownership         DeviceOwnership    `json:"ownership"`
	AzureDid          null.String        `json:"azure_did"`
	EnrolledAt        time.Time          `json:"enrolled_at"`
	Lastseen          sql.NullTime       `json:"lastseen"`
}

type GetDevicesInGroupParams

type GetDevicesInGroupParams struct {
	GroupID  string `json:"group_id"`
	TenantID string `json:"tenant_id"`
	Limit    int32  `json:"limit"`
	Offset   int32  `json:"offset"`
}

type GetDevicesInGroupRow

type GetDevicesInGroupRow struct {
	ID   string      `json:"id"`
	Name null.String `json:"name"`
}

type GetDevicesParams

type GetDevicesParams struct {
	TenantID string `json:"tenant_id"`
	Limit    int32  `json:"limit"`
	Offset   int32  `json:"offset"`
}

type GetDevicesRow

type GetDevicesRow struct {
	ID       string             `json:"id"`
	Protocol ManagementProtocol `json:"protocol"`
	Name     null.String        `json:"name"`
	Model    null.String        `json:"model"`
}

type GetGroupParams

type GetGroupParams struct {
	ID       string `json:"id"`
	TenantID string `json:"tenant_id"`
}

type GetGroupRow

type GetGroupRow struct {
	ID          string      `json:"id"`
	Name        null.String `json:"name"`
	Description null.String `json:"description"`
}

type GetGroupsParams

type GetGroupsParams struct {
	TenantID string `json:"tenant_id"`
	Limit    int32  `json:"limit"`
	Offset   int32  `json:"offset"`
}

type GetGroupsRow

type GetGroupsRow struct {
	ID          string      `json:"id"`
	Name        null.String `json:"name"`
	Description null.String `json:"description"`
}

type GetObjectParams

type GetObjectParams struct {
	ID       string `json:"id"`
	TenantID string `json:"tenant_id"`
}

type GetObjectRow

type GetObjectRow struct {
	Filename null.String `json:"filename"`
	Data     []byte      `json:"data"`
}

type GetPoliciesInGroupParams

type GetPoliciesInGroupParams struct {
	GroupID  string `json:"group_id"`
	TenantID string `json:"tenant_id"`
	Limit    int32  `json:"limit"`
	Offset   int32  `json:"offset"`
}

type GetPoliciesInGroupRow

type GetPoliciesInGroupRow struct {
	ID   string      `json:"id"`
	Name null.String `json:"name"`
}

type GetPoliciesParams

type GetPoliciesParams struct {
	TenantID string `json:"tenant_id"`
	Limit    int32  `json:"limit"`
	Offset   int32  `json:"offset"`
}

type GetPoliciesRow

type GetPoliciesRow struct {
	ID          string      `json:"id"`
	Name        null.String `json:"name"`
	Type        string      `json:"type"`
	Description null.String `json:"description"`
}

type GetPolicyGroupsParams

type GetPolicyGroupsParams struct {
	PolicyID string `json:"policy_id"`
	TenantID string `json:"tenant_id"`
}

type GetPolicyGroupsRow

type GetPolicyGroupsRow struct {
	ID   string      `json:"id"`
	Name null.String `json:"name"`
}

type GetPolicyParams

type GetPolicyParams struct {
	ID       string `json:"id"`
	TenantID string `json:"tenant_id"`
}

type GetPolicyRow

type GetPolicyRow struct {
	Name        null.String     `json:"name"`
	Type        string          `json:"type"`
	Payload     json.RawMessage `json:"payload"`
	Description null.String     `json:"description"`
}

type GetRawCertRow

type GetRawCertRow struct {
	Cert []byte `json:"cert"`
	Key  []byte `json:"key"`
}

type GetTenantDomainParams

type GetTenantDomainParams struct {
	Domain   string `json:"domain"`
	TenantID string `json:"tenant_id"`
}

type GetTenantDomainRow

type GetTenantDomainRow struct {
	LinkingCode string `json:"linking_code"`
	Verified    bool   `json:"verified"`
}

type GetTenantDomainsRow

type GetTenantDomainsRow struct {
	Domain      string `json:"domain"`
	LinkingCode string `json:"linking_code"`
	Verified    bool   `json:"verified"`
}

type GetTenantRow

type GetTenantRow struct {
	DisplayName     null.String `json:"display_name"`
	PrimaryDomain   string      `json:"primary_domain"`
	Email           null.String `json:"email"`
	Phone           null.String `json:"phone"`
	AfwEnterpriseID null.String `json:"afw_enterprise_id"`
}

type GetUserPermissionLevelForTenantParams

type GetUserPermissionLevelForTenantParams struct {
	UserUpn  string `json:"user_upn"`
	TenantID string `json:"tenant_id"`
}

type GetUserRow

type GetUserRow struct {
	UPN        string      `json:"upn"`
	Fullname   null.String `json:"fullname"`
	Disabled   bool        `json:"disabled"`
	AzureadOid null.String `json:"azuread_oid"`
}

type GetUserSecureRow

type GetUserSecureRow struct {
	Fullname       null.String  `json:"fullname"`
	Disabled       bool         `json:"disabled"`
	Password       null.String  `json:"password"`
	PasswordExpiry sql.NullTime `json:"password_expiry"`
	MfaToken       null.String  `json:"mfa_token"`
	TenantID       null.String  `json:"tenant_id"`
}

type GetUserTenantsRow

type GetUserTenantsRow struct {
	ID            string      `json:"id"`
	DisplayName   null.String `json:"display_name"`
	PrimaryDomain string      `json:"primary_domain"`
	Description   null.String `json:"description"`
}

type GetUsersInTenantByQueryParams

type GetUsersInTenantByQueryParams struct {
	TenantID null.String `json:"tenant_id"`
	Limit    int32       `json:"limit"`
	Offset   int32       `json:"offset"`
	UPN      string      `json:"upn"`
}

type GetUsersInTenantByQueryRow

type GetUsersInTenantByQueryRow struct {
	UPN        string      `json:"upn"`
	Fullname   null.String `json:"fullname"`
	AzureadOid null.String `json:"azuread_oid"`
}

type GetUsersInTenantParams

type GetUsersInTenantParams struct {
	TenantID null.String `json:"tenant_id"`
	Limit    int32       `json:"limit"`
	Offset   int32       `json:"offset"`
}

type GetUsersInTenantRow

type GetUsersInTenantRow struct {
	UPN        string      `json:"upn"`
	Fullname   null.String `json:"fullname"`
	AzureadOid null.String `json:"azuread_oid"`
}

type Group

type Group struct {
	ID          string      `json:"id"`
	TenantID    string      `json:"tenant_id"`
	Name        null.String `json:"name"`
	Description null.String `json:"description"`
}

type GroupDevice

type GroupDevice struct {
	GroupID  string `json:"group_id"`
	DeviceID string `json:"device_id"`
}

type GroupPolicy

type GroupPolicy struct {
	GroupID  string `json:"group_id"`
	PolicyID string `json:"policy_id"`
}

type ManagementProtocol

type ManagementProtocol string
const (
	ManagementProtocolWindows ManagementProtocol = "windows"
	ManagementProtocolAgent   ManagementProtocol = "agent"
	ManagementProtocolApple   ManagementProtocol = "apple"
	ManagementProtocolAndroid ManagementProtocol = "android"
)

func (*ManagementProtocol) Scan

func (e *ManagementProtocol) Scan(src interface{}) error

type ManagementScope

type ManagementScope string
const (
	ManagementScopeDevice     ManagementScope = "device"
	ManagementScopeAfwProfile ManagementScope = "afw_profile"
	ManagementScopeUser       ManagementScope = "user"
)

func (*ManagementScope) Scan

func (e *ManagementScope) Scan(src interface{}) error

type NewApplicationParams

type NewApplicationParams struct {
	Name     null.String `json:"name"`
	TenantID string      `json:"tenant_id"`
}

type NewGlobalUserParams

type NewGlobalUserParams struct {
	UPN            string       `json:"upn"`
	Fullname       null.String  `json:"fullname"`
	Password       null.String  `json:"password"`
	PasswordExpiry sql.NullTime `json:"password_expiry"`
}

type NewGroupParams

type NewGroupParams struct {
	Name     null.String `json:"name"`
	TenantID string      `json:"tenant_id"`
}

type NewPolicyParams

type NewPolicyParams struct {
	Name     null.String `json:"name"`
	Type     string      `json:"type"`
	TenantID string      `json:"tenant_id"`
}

type NewTenantParams

type NewTenantParams struct {
	DisplayName   null.String `json:"display_name"`
	PrimaryDomain string      `json:"primary_domain"`
}

type NewUserFromAzureADParams

type NewUserFromAzureADParams struct {
	UPN        string      `json:"upn"`
	Fullname   null.String `json:"fullname"`
	AzureadOid null.String `json:"azuread_oid"`
}

type NewUserParams

type NewUserParams struct {
	UPN      string      `json:"upn"`
	Fullname null.String `json:"fullname"`
	Password null.String `json:"password"`
	TenantID null.String `json:"tenant_id"`
}

type Object

type Object struct {
	ID       string      `json:"id"`
	TenantID string      `json:"tenant_id"`
	Filename null.String `json:"filename"`
	Data     []byte      `json:"data"`
}

type Operation

type Operation string
const (
	OperationINSERT Operation = "INSERT"
	OperationUPDATE Operation = "UPDATE"
	OperationDELETE Operation = "DELETE"
)

func (*Operation) Scan

func (e *Operation) Scan(src interface{}) error

type Policy

type Policy struct {
	ID          string          `json:"id"`
	TenantID    string          `json:"tenant_id"`
	Name        null.String     `json:"name"`
	Type        string          `json:"type"`
	Payload     json.RawMessage `json:"payload"`
	Description null.String     `json:"description"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func Prepare

func Prepare(ctx context.Context, db DBTX) (*Queries, error)

func (*Queries) AFWCreateState

func (q *Queries) AFWCreateState(ctx context.Context) (string, error)

func (*Queries) AFWGetAndRemoveState

func (q *Queries) AFWGetAndRemoveState(ctx context.Context, id string) (null.String, error)

------ Android For Work Enrollment State

func (*Queries) AFWUpdateState

func (q *Queries) AFWUpdateState(ctx context.Context, arg AFWUpdateStateParams) error

func (*Queries) AFWUpdateTenant

func (q *Queries) AFWUpdateTenant(ctx context.Context, arg AFWUpdateTenantParams) error

func (*Queries) AddDeviceToGroup

func (q *Queries) AddDeviceToGroup(ctx context.Context, arg AddDeviceToGroupParams) error

func (*Queries) AddDomainToTenant

func (q *Queries) AddDomainToTenant(ctx context.Context, arg AddDomainToTenantParams) (string, error)

func (*Queries) AddPolicyToGroup

func (q *Queries) AddPolicyToGroup(ctx context.Context, arg AddPolicyToGroupParams) error

func (*Queries) Close

func (q *Queries) Close() error

func (*Queries) CreateDevice

func (q *Queries) CreateDevice(ctx context.Context, arg CreateDeviceParams) (string, error)

------ Device Actions

func (*Queries) CreateObject

func (q *Queries) CreateObject(ctx context.Context, arg CreateObjectParams) error

func (*Queries) CreateRawCert

func (q *Queries) CreateRawCert(ctx context.Context, arg CreateRawCertParams) error

func (*Queries) DeleteApplication

func (q *Queries) DeleteApplication(ctx context.Context, arg DeleteApplicationParams) error

func (*Queries) DeleteDomain

func (q *Queries) DeleteDomain(ctx context.Context, arg DeleteDomainParams) error

func (*Queries) DeleteGroup

func (q *Queries) DeleteGroup(ctx context.Context, arg DeleteGroupParams) error

func (*Queries) DeletePolicy

func (q *Queries) DeletePolicy(ctx context.Context, arg DeletePolicyParams) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, upn string) error

func (*Queries) DeleteUserInTenant

func (q *Queries) DeleteUserInTenant(ctx context.Context, arg DeleteUserInTenantParams) error

func (*Queries) GetApplication

func (q *Queries) GetApplication(ctx context.Context, arg GetApplicationParams) (GetApplicationRow, error)

func (*Queries) GetApplicationTargets

func (q *Queries) GetApplicationTargets(ctx context.Context, arg GetApplicationTargetsParams) ([]GetApplicationTargetsRow, error)

func (*Queries) GetApplications

func (q *Queries) GetApplications(ctx context.Context, arg GetApplicationsParams) ([]GetApplicationsRow, error)

func (*Queries) GetDevice

func (q *Queries) GetDevice(ctx context.Context, arg GetDeviceParams) (GetDeviceRow, error)

func (*Queries) GetDeviceForManagement

func (q *Queries) GetDeviceForManagement(ctx context.Context, udid string) (GetDeviceForManagementRow, error)

func (*Queries) GetDeviceGroups

func (q *Queries) GetDeviceGroups(ctx context.Context, arg GetDeviceGroupsParams) ([]GetDeviceGroupsRow, error)

func (*Queries) GetDevicePolicies

func (q *Queries) GetDevicePolicies(ctx context.Context, deviceID string) ([]GetDevicePoliciesRow, error)

func (*Queries) GetDevices

func (q *Queries) GetDevices(ctx context.Context, arg GetDevicesParams) ([]GetDevicesRow, error)

func (*Queries) GetDevicesInGroup

func (q *Queries) GetDevicesInGroup(ctx context.Context, arg GetDevicesInGroupParams) ([]GetDevicesInGroupRow, error)

func (*Queries) GetDevicesWithPolicy

func (q *Queries) GetDevicesWithPolicy(ctx context.Context, policyID string) ([]string, error)

func (*Queries) GetGroup

func (q *Queries) GetGroup(ctx context.Context, arg GetGroupParams) (GetGroupRow, error)

func (*Queries) GetGroups

func (q *Queries) GetGroups(ctx context.Context, arg GetGroupsParams) ([]GetGroupsRow, error)

func (*Queries) GetObject

func (q *Queries) GetObject(ctx context.Context, arg GetObjectParams) (GetObjectRow, error)

------ Object Actions

func (*Queries) GetPolicies

func (q *Queries) GetPolicies(ctx context.Context, arg GetPoliciesParams) ([]GetPoliciesRow, error)

func (*Queries) GetPoliciesInGroup

func (q *Queries) GetPoliciesInGroup(ctx context.Context, arg GetPoliciesInGroupParams) ([]GetPoliciesInGroupRow, error)

func (*Queries) GetPolicy

func (q *Queries) GetPolicy(ctx context.Context, arg GetPolicyParams) (GetPolicyRow, error)

func (*Queries) GetPolicyGroups

func (q *Queries) GetPolicyGroups(ctx context.Context, arg GetPolicyGroupsParams) ([]GetPolicyGroupsRow, error)

func (*Queries) GetRawCert

func (q *Queries) GetRawCert(ctx context.Context, id string) (GetRawCertRow, error)

------ Certificates

func (*Queries) GetTenant

func (q *Queries) GetTenant(ctx context.Context, id string) (GetTenantRow, error)

------ Tenant

func (*Queries) GetTenantDomain

func (q *Queries) GetTenantDomain(ctx context.Context, arg GetTenantDomainParams) (GetTenantDomainRow, error)

func (*Queries) GetTenantDomains

func (q *Queries) GetTenantDomains(ctx context.Context, tenantID string) ([]GetTenantDomainsRow, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, upn string) (GetUserRow, error)

func (*Queries) GetUserCount

func (q *Queries) GetUserCount(ctx context.Context) (int64, error)

DO NOT RUN THIS FILE. It is used along with sqlc to generate type safe Go from SQL

func (*Queries) GetUserPermissionLevelForTenant

func (q *Queries) GetUserPermissionLevelForTenant(ctx context.Context, arg GetUserPermissionLevelForTenantParams) (UserPermissionLevel, error)

func (*Queries) GetUserSecure

func (q *Queries) GetUserSecure(ctx context.Context, upn string) (GetUserSecureRow, error)

func (*Queries) GetUserTenants

func (q *Queries) GetUserTenants(ctx context.Context, userUpn string) ([]GetUserTenantsRow, error)

func (*Queries) GetUsersInTenant

func (q *Queries) GetUsersInTenant(ctx context.Context, arg GetUsersInTenantParams) ([]GetUsersInTenantRow, error)

func (*Queries) GetUsersInTenantByQuery

func (q *Queries) GetUsersInTenantByQuery(ctx context.Context, arg GetUsersInTenantByQueryParams) ([]GetUsersInTenantByQueryRow, error)

Once https://github.com/kyleconroy/sqlc/issues/778 is fixed change query to (including the ByQuery one): SELECT upn, fullname, azuread_oid FROM users INNER JOIN tenant_users ON users.upn = tenant_users.user_upn WHERE tenant_users.tenant_id = $1 UNION ALL SELECT upn, fullname, azuread_oid FROM users WHERE tenant_id = $1;

func (*Queries) NewApplication

func (q *Queries) NewApplication(ctx context.Context, arg NewApplicationParams) (string, error)

------ Application Actions

func (*Queries) NewGlobalUser

func (q *Queries) NewGlobalUser(ctx context.Context, arg NewGlobalUserParams) error

func (*Queries) NewGroup

func (q *Queries) NewGroup(ctx context.Context, arg NewGroupParams) (string, error)

------ Group Actions

func (*Queries) NewPolicy

func (q *Queries) NewPolicy(ctx context.Context, arg NewPolicyParams) (string, error)

------ Policy Actions

func (*Queries) NewTenant

func (q *Queries) NewTenant(ctx context.Context, arg NewTenantParams) (string, error)

func (*Queries) NewUser

func (q *Queries) NewUser(ctx context.Context, arg NewUserParams) error

------ User

func (*Queries) NewUserFromAzureAD

func (q *Queries) NewUserFromAzureAD(ctx context.Context, arg NewUserFromAzureADParams) error

func (*Queries) RemoveDeviceFromGroup

func (q *Queries) RemoveDeviceFromGroup(ctx context.Context, arg RemoveDeviceFromGroupParams) error

func (*Queries) RemovePolicyFromGroup

func (q *Queries) RemovePolicyFromGroup(ctx context.Context, arg RemovePolicyFromGroupParams) error

func (*Queries) RemoveUserFromTenant

func (q *Queries) RemoveUserFromTenant(ctx context.Context, arg RemoveUserFromTenantParams) error

func (*Queries) ScopeUserToTenant

func (q *Queries) ScopeUserToTenant(ctx context.Context, arg ScopeUserToTenantParams) error

func (*Queries) UpdateApplication

func (q *Queries) UpdateApplication(ctx context.Context, arg UpdateApplicationParams) error

func (*Queries) UpdateDevice

func (q *Queries) UpdateDevice(ctx context.Context, arg UpdateDeviceParams) error

func (*Queries) UpdateDomain

func (q *Queries) UpdateDomain(ctx context.Context, arg UpdateDomainParams) error

func (*Queries) UpdateGroup

func (q *Queries) UpdateGroup(ctx context.Context, arg UpdateGroupParams) error

func (*Queries) UpdateObject

func (q *Queries) UpdateObject(ctx context.Context, arg UpdateObjectParams) error

func (*Queries) UpdatePolicy

func (q *Queries) UpdatePolicy(ctx context.Context, arg UpdatePolicyParams) error

func (*Queries) UpdateTenant

func (q *Queries) UpdateTenant(ctx context.Context, arg UpdateTenantParams) error

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error

func (*Queries) UpdateUserInTenant

func (q *Queries) UpdateUserInTenant(ctx context.Context, arg UpdateUserInTenantParams) (string, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type RemoveDeviceFromGroupParams

type RemoveDeviceFromGroupParams struct {
	GroupID  string `json:"group_id"`
	DeviceID string `json:"device_id"`
}

type RemovePolicyFromGroupParams

type RemovePolicyFromGroupParams struct {
	GroupID  string `json:"group_id"`
	PolicyID string `json:"policy_id"`
}

type RemoveUserFromTenantParams

type RemoveUserFromTenantParams struct {
	UserUpn  string `json:"user_upn"`
	TenantID string `json:"tenant_id"`
}

type ScopeUserToTenantParams

type ScopeUserToTenantParams struct {
	UserUpn         string              `json:"user_upn"`
	TenantID        string              `json:"tenant_id"`
	PermissionLevel UserPermissionLevel `json:"permission_level"`
}

type Tenant

type Tenant struct {
	ID              string      `json:"id"`
	DisplayName     null.String `json:"display_name"`
	PrimaryDomain   string      `json:"primary_domain"`
	Email           null.String `json:"email"`
	Phone           null.String `json:"phone"`
	Description     null.String `json:"description"`
	AfwEnterpriseID null.String `json:"afw_enterprise_id"`
}

type TenantDomain

type TenantDomain struct {
	TenantID    string `json:"tenant_id"`
	Domain      string `json:"domain"`
	LinkingCode string `json:"linking_code"`
	Verified    bool   `json:"verified"`
}

type TenantUser

type TenantUser struct {
	UserUpn         string              `json:"user_upn"`
	TenantID        string              `json:"tenant_id"`
	PermissionLevel UserPermissionLevel `json:"permission_level"`
}

type UpdateApplicationParams

type UpdateApplicationParams struct {
	ID          string      `json:"id"`
	TenantID    string      `json:"tenant_id"`
	Name        null.String `json:"name"`
	Description null.String `json:"description"`
	Publisher   null.String `json:"publisher"`
}

type UpdateDeviceParams

type UpdateDeviceParams struct {
	ID       string      `json:"id"`
	TenantID string      `json:"tenant_id"`
	Name     null.String `json:"name"`
}

type UpdateDomainParams

type UpdateDomainParams struct {
	Domain   string `json:"domain"`
	TenantID string `json:"tenant_id"`
	Verified bool   `json:"verified"`
}

type UpdateGroupParams

type UpdateGroupParams struct {
	ID       string      `json:"id"`
	TenantID string      `json:"tenant_id"`
	Name     null.String `json:"name"`
}

type UpdateObjectParams

type UpdateObjectParams struct {
	ID       string      `json:"id"`
	TenantID string      `json:"tenant_id"`
	Filename null.String `json:"filename"`
	Data     []byte      `json:"data"`
}

type UpdatePolicyParams

type UpdatePolicyParams struct {
	ID       string          `json:"id"`
	TenantID string          `json:"tenant_id"`
	Name     null.String     `json:"name"`
	Payload  json.RawMessage `json:"payload"`
}

type UpdateTenantParams

type UpdateTenantParams struct {
	ID          string      `json:"id"`
	DisplayName null.String `json:"display_name"`
	Email       null.String `json:"email"`
	Phone       null.String `json:"phone"`
}

type UpdateUserInTenantParams

type UpdateUserInTenantParams struct {
	UPN      string      `json:"upn"`
	TenantID null.String `json:"tenant_id"`
	Fullname null.String `json:"fullname"`
	Disabled bool        `json:"disabled"`
	Password null.String `json:"password"`
}

type UpdateUserParams

type UpdateUserParams struct {
	UPN            string       `json:"upn"`
	Fullname       null.String  `json:"fullname"`
	Password       null.String  `json:"password"`
	PasswordExpiry sql.NullTime `json:"password_expiry"`
}

type User

type User struct {
	UPN            string       `json:"upn"`
	Fullname       null.String  `json:"fullname"`
	Disabled       bool         `json:"disabled"`
	Password       null.String  `json:"password"`
	PasswordExpiry sql.NullTime `json:"password_expiry"`
	MfaToken       null.String  `json:"mfa_token"`
	AzureadOid     null.String  `json:"azuread_oid"`
	TenantID       null.String  `json:"tenant_id"`
}

type UserPermissionLevel

type UserPermissionLevel string
const (
	UserPermissionLevelUser          UserPermissionLevel = "user"
	UserPermissionLevelAdministrator UserPermissionLevel = "administrator"
)

func (*UserPermissionLevel) Scan

func (e *UserPermissionLevel) Scan(src interface{}) error

Jump to

Keyboard shortcuts

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