Documentation ¶
Index ¶
- type AzureSqlManagedUserManager
- func (s *AzureSqlManagedUserManager) ConnectToSqlDbAsCurrentUser(ctx context.Context, server string, database string) (db *sql.DB, err error)
- func (s *AzureSqlManagedUserManager) Delete(ctx context.Context, obj runtime.Object, opts ...resourcemanager.ConfigOption) (bool, error)
- func (s *AzureSqlManagedUserManager) DeleteSecrets(ctx context.Context, instance *v1alpha1.AzureSQLManagedUser, ...) error
- func (s *AzureSqlManagedUserManager) DropUser(ctx context.Context, db *sql.DB, user string) error
- func (s *AzureSqlManagedUserManager) EnableUser(ctx context.Context, MIName string, MIUserClientId string, db *sql.DB) error
- func (s *AzureSqlManagedUserManager) Ensure(ctx context.Context, obj runtime.Object, opts ...resourcemanager.ConfigOption) (bool, error)
- func (s *AzureSqlManagedUserManager) GetDB(ctx context.Context, subscriptionID string, resourceGroupName string, ...) (azuresql.Database, error)
- func (s *AzureSqlManagedUserManager) GetParents(obj runtime.Object) ([]resourcemanager.KubeParent, error)
- func (s *AzureSqlManagedUserManager) GetStatus(obj runtime.Object) (*v1alpha1.ASOStatus, error)
- func (s *AzureSqlManagedUserManager) GrantUserRoles(ctx context.Context, user string, roles []string, db *sql.DB) error
- func (s *AzureSqlManagedUserManager) UpdateSecret(ctx context.Context, instance *v1alpha1.AzureSQLManagedUser, ...) error
- func (s *AzureSqlManagedUserManager) UserExists(ctx context.Context, db *sql.DB, username string) (bool, error)
- type SqlManagedUserManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureSqlManagedUserManager ¶
type AzureSqlManagedUserManager struct { Creds config.Credentials SecretClient secrets.SecretClient Scheme *runtime.Scheme }
func NewAzureSqlManagedUserManager ¶
func NewAzureSqlManagedUserManager(creds config.Credentials, secretClient secrets.SecretClient, scheme *runtime.Scheme) *AzureSqlManagedUserManager
func (*AzureSqlManagedUserManager) ConnectToSqlDbAsCurrentUser ¶
func (s *AzureSqlManagedUserManager) ConnectToSqlDbAsCurrentUser(ctx context.Context, server string, database string) (db *sql.DB, err error)
ConnectToSqlDb connects to the SQL db using the current identity of operator (should be MI)
func (*AzureSqlManagedUserManager) Delete ¶
func (s *AzureSqlManagedUserManager) Delete(ctx context.Context, obj runtime.Object, opts ...resourcemanager.ConfigOption) (bool, error)
Delete deletes a user
func (*AzureSqlManagedUserManager) DeleteSecrets ¶
func (s *AzureSqlManagedUserManager) DeleteSecrets(ctx context.Context, instance *v1alpha1.AzureSQLManagedUser, secretClient secrets.SecretClient) error
DeleteSecret deletes a secret
func (*AzureSqlManagedUserManager) EnableUser ¶
func (s *AzureSqlManagedUserManager) EnableUser(ctx context.Context, MIName string, MIUserClientId string, db *sql.DB) error
EnableUser creates user with secret credentials
func (*AzureSqlManagedUserManager) Ensure ¶
func (s *AzureSqlManagedUserManager) Ensure(ctx context.Context, obj runtime.Object, opts ...resourcemanager.ConfigOption) (bool, error)
Ensure that user exists
func (*AzureSqlManagedUserManager) GetDB ¶
func (s *AzureSqlManagedUserManager) GetDB(ctx context.Context, subscriptionID string, resourceGroupName string, serverName string, databaseName string) (azuresql.Database, error)
GetDB retrieves a database
func (*AzureSqlManagedUserManager) GetParents ¶
func (s *AzureSqlManagedUserManager) GetParents(obj runtime.Object) ([]resourcemanager.KubeParent, error)
GetParents gets the parents of the user
func (*AzureSqlManagedUserManager) GrantUserRoles ¶
func (s *AzureSqlManagedUserManager) GrantUserRoles(ctx context.Context, user string, roles []string, db *sql.DB) error
GrantUserRoles grants roles to a user for a given database
func (*AzureSqlManagedUserManager) UpdateSecret ¶
func (s *AzureSqlManagedUserManager) UpdateSecret(ctx context.Context, instance *v1alpha1.AzureSQLManagedUser, secretClient secrets.SecretClient) error
UpdateSecret gets or creates a secret
func (*AzureSqlManagedUserManager) UserExists ¶
func (s *AzureSqlManagedUserManager) UserExists(ctx context.Context, db *sql.DB, username string) (bool, error)
UserExists checks if db contains user
type SqlManagedUserManager ¶
type SqlManagedUserManager interface { GetDB(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (azuresql.Database, error) ConnectToSqlDbAsCurrentUser(ctx context.Context, drivername string, server string, dbname string) (*sql.DB, error) DeleteSecrets(ctx context.Context, instance *v1alpha1.AzureSQLManagedUser, secretClient secrets.SecretClient) error UpdateSecret(ctx context.Context, instance *v1alpha1.AzureSQLManagedUser, secretClient secrets.SecretClient) error EnableUser(ctx context.Context, MIName string, MIUserClientId string, db *sql.DB) error GrantUserRoles(ctx context.Context, user string, roles []string, db *sql.DB) error DropUser(ctx context.Context, db *sql.DB, user string) error UserExists(ctx context.Context, db *sql.DB, username string) (bool, error) // also embed methods from AsyncClient resourcemanager.ARMClient }
Click to show internal directories.
Click to hide internal directories.