# Packages
No description provided by the author
# Functions
No description provided by the author
AddAdminAction adds a new admin to the cluster database and creates a key pair for it.
Add an m3 admin account with the given name and email.
AddPermissionToDB insers a effect-resources-actions combination to the DB after validating that it's not duplicated.
AddServiceAccount adds a new service accounts to the tenant's database.
Creates a storage cluster in the DB.
Creates a storage group in the DB.
AddUser adds a new user to the tenant's database.
No description provided by the author
No description provided by the author
AssignMultiplePermissionsToSA takes a list of permissions and assigns them to a single service account.
AssignMultiplePermissionsToSADB inserts on table service_accounts_permissions, multiple permissions to a single service account.
Creates a storage cluster in the DB.
AssignPermissionAction assigns a single permission to multiple service accounts.
No description provided by the author
ChangeBucketAccess changes access type assigned to the given bucket.
ClaimTenant claims a tenant to a new account, marks it as not available and enables it for the router.
CompleteSignup takes a urlToken and a password and changes the user's password, invalids all current active user's sessions and then marks the urlToken as used.
No description provided by the author
Creates a service that will resolve to any of the hosts within the storage group this tenant lives in This will create a deployment for the provided `StorageGroup` using the provided list of `StorageGroupTenant`.
No description provided by the author
CreateProvisioningSchema creates a db schema for provisioning.
No description provided by the author
Creates a headless service that will point to a specific node inside a storage group.
No description provided by the author
CreateTenantSchema creates a db schema for the tenant.
CreateTenantSecrets creates the "secrets" of a tenant.
Creates a service that will resolve to any of the hosts within the storage group this tenant lives in.
CreateTenantSchema creates a db schema for the tenant.
DeleteBucket Deletes a bucket in the given tenant's MinIO.
DeleteBulkPermissionActionDB deletes a bulk of permission actions rows from the database.
DeleteBulkPermissionResourceDB deletes a permission resource row from the database.
DeleteMultiplePermissionsOnSADB removes on table service_accounts_permissions, multiple permissions on a single service account.
DeleteNginxLBDeployments deletes the nginx-resolver old deployments and indicates the completion of the deletion via the returned receiver channel.
No description provided by the author
DeleteServiceAccountDB deletes a service account from the database and cascades it's dependencies.
DeleteTenantDB returns a channel that will close once the schema is deleted.
DeleteTenantNamespace deletes a tenant namespace on k8s.
DeleteTenantRecord unregisters a tenant from the main DB tenants table, rendering the tenant invisible to the cluster.
DeleteTenantSecrets removes the tenant main secret.
DeleteTenantServiceInStorageGroup will remove a tenant service from a specified Storage Group.
DeleteUser removes a user from the tenant's database with the user's secrets and it's MinIO related user.
DeployNginxResolver creates a new nginx-resolver deployment with the updated rules.
DeprovisionTenantOnStorageGroup deletes the tenant from the storage group and deletes all tenant's data from disks.
DeprovisionTenantTask runs all the logic to remove a tenant from the cluster.
DestroyTenantSchema will drop the tenant schema from the DB.
DifferenceArrays returns the elements in `a` that aren't in `b`.
No description provided by the author
GetAdminByEmail retrieves an admin by it's email.
GetAdminTokenDetails get the details for the provided AdminToken.
GetAdminTokenDetails get the details for the provided AdminToken.
GetAllServiceAccountsForPermission returns a list of all service accounts using a permission.
GetAllTenantRoutes returns a list of all enabled tenants that currently exists on the cluster their subdomain, service name and port.
GetAllThePermissionForServiceAccount returns a list of permissions that are assigned to a service account.
GetAllThePermissionForServiceAccountWithQueryWrapper returns a list of permissions that are assigned to a service account.
GetBucketAccess returns the access type for the given bucket name.
GetBucketUsageMetrics Gets latest DataUsage info from Tenant's MinIO servers.
No description provided by the author
GetCredentialsForServiceAccount gets the access_key assigned to the provided service account.
GetDailyAvgBucketUsageFromDB get total average bucket usage metrics per day on one month.
GetLatestBucketsSizes return latest buckets sizes map.
GetLatestTotalBuckets get the latest total number of buckets during a month period.
Returns a list of tenants that are allocated to the provided `StorageGroup`.
No description provided by the author
Returns a list of nodes for a storage group.
GetPermissionByID retrieves a permission by it's id.
GetPermissionBySlug retrieves a permission by it's id-name.
GetRandString generates a random string with the defined size length.
GetServiceAccountByID retrieves a permission by it's id.
GetServiceAccountBySlug retrieves a permission by it's id-name.
GetServiceAccountList returns a page of services accounts for the provided tenant.
GetSessionStatusFromString converts string type to SessionStatus and throws error if string not is not a valid type.
GetStorageClusterByName returns a storage cluster by name.
GetStorageGroupByID returns a storage group by name.
No description provided by the author
GetTemplate gets a template from the templates folder and applies the template date.
No description provided by the author
GetTenantByDomainWithCtx gets the Tenant if it exists on the m3.provisining.tenants table search is done by tenant name.
GetTenantByID returns a tenant by id.
GetTenantConfig returns the access/secret keys for a given tenant.
Returns a list of tenants that are allocated to the provided `StorageGroup`.
GetTenantTokenDetails get the details for the provided urlToken.
GetTenantUsageCostMultiplier gets tenant's cost multiplier used for charging.
GetTenantWithCtxByID gets the Tenant if it exists on the m3.provisining.tenants table search is done by tenant id.
GetTenantWithCtxByServiceName gets the Tenant if it exists on the m3.provisining.tenants table search is done by tenant service name.
GetTotalMonthBucketUsageFromDB get max total bucket usage of the month.
GetTotalNumberOfServiceAccounts returns the total number of service accounts for a tenant.
GetTotalNumberOfUsers.
GetUserByEmail searches for the user by Email in the defined tenant's database and returns the User if it was found.
GetUserByID searches for the user by ID in the defined tenant's database and returns the User if it was found.
GetUserSessionsFromDB get all sessions for a particular user.
GetUsersForTenant returns a page of users for the provided tenant.
GetUserUICredentials returns the UI access/secret key pair for a given user for a given tenant.
GetValidSession validates the sessionID available in the grpc metadata headers and returns the session row id and tenant's id.
GrabAvailableTenant will select an available tenant and mark it for update so it cannot be grabbed by a different process.
HashPassword hashes the password one way.
InsertAction inserts to the permissions_actions table a new record, generates an ID for the action.
InsertAdmin inserts an admin record into the `admins` table.
InsertPermission inserts to the permissions table a new record, generates an ID for the passes permission.
InsertResource inserts to the permissions_resources table a new record, generates an ID for the resources.
Creates a tenant in the DB if tenant short name is unique.
IsMinioReadyRetry tries maxReadinessTries times and returns if is ready after retries.
getSetupDoneSecret gets m3 setup secret from kubernetes secrets.
ListBuckets for the given tenant's short name.
ListPermissions returns a page of Permissions for the provided tenant.
MakeBucket will get the credentials for a given tenant and use the operator keys to create a bucket using minio-go TODO: allow to spcify the user performing the action (like in the API/gRPC case).
MapPermissionsToIDs returns an error if at least one of the ids provided is not on the database.
MapServiceAccountsIDsToSlugs returns an error if at least one of the ids provided is not on the database.
MapServiceAccountsToIDs returns an error if at least one of the ids provided is not on the database.
MarkAdminTokenConsumed updates the record for the AdminToken as is it has been used.
MarkInvitationAccepted sets the invitation accepted for a users a true.
MarkTokenConsumed updates the record for the urlToken as is it has been used.
MigrateTenantDB executes the migrations for a given tenant, this may take time.
NewAdminClient gives a new client interface.
NewAdminToken generates and stores a new AdminToken for the provided user, with the specified validity.
No description provided by the author
Creates a new `Context` with no tenant tenant that holds transaction and `context.Context` to control timeouts and cancellations.
Creates a new `Context` with no tenant tenant that holds transaction and `context.Context` to control timeouts and cancellations starting from a grpc context which should contain wether the user is authenticated or not.
No description provided by the author
NewPermissionObj creates a new Permission from a list of raw resources (bucket/pattern/*) and actions.
Creates a new `Context` with no tenant tenant that holds transaction and `context.Context` to control timeouts and cancellations starting from a grpc context which should contain wether the user is authenticated or not.
NewURLToken generates and stores a new urlToken for the provided user, with the specified validity.
No description provided by the author
NodeAdd adds a new node for the cluster to administer.
ParseAndValidateJwtToken parses and validates the jwt token.
No description provided by the author
provisions the storage group supporting services that point to each node in the storage group.
ProvisionTenantDB runs the tenant migrations for the provided tenant.
spins up the tenant on the target storage group, waits for it to start, then shuts it down.
No description provided by the author
ProvisionTenantTask takes a task for provisioning of a tenant and executes it.
No description provided by the author
RecreateTenantFolderInDisk deletes the tenant folder in disk and recreates it.
RecurrentTenantMetricsCalculation loop that calculates bucket usage metrics for all tenants and saves them on the db.
ReDeployNginxResolver destroy current nginx deployment and replace it with a new one that will take latest configMap configuration.
Based on the current list of tenants for the `StorageGroup` it re-deploys it.
RemoveMinioUser deletes a Minio User assigned to a particular service account.
RemoveServiceAccount deletes a serviceAccount related to a particular tenant.
RestartTenantServers restarts MinIO servers for a particular tenant.
This runs all the migrations on the cluster/migrations folder, if some migrations were already applied it then will apply the missing migrations.
RunTask runs a task by id and records the result of if on the task record.
ScheduleDeprovisionTenantTask creates a task to be consumed by a kubernetes job.
No description provided by the author
No description provided by the author
Selects from all the available storage groups for one with space available.
No description provided by the author
No description provided by the author
SendEmailToUser schedules a task to send an email to a user with the defined data.
SendEmailToUserTask creates a task to send an email to a user.
SendMail sends an email to `toName <toEmail>` with the provided subject and body.
CompleteSignup takes a urlToken and a password and changes the user password and then marks the token as used.
No description provided by the author
No description provided by the author
No description provided by the author
SetEmailTemplate upserts a template into the database.
SetMinioServiceAccountStatus Updates service Account enabled status and Minio user related status.
SetupDBAction runs all the operations to setup the DB or migrate it.
SetupEtcCluster performs the setup of the m3 main etcd cluster.
SetupM3Secrets creates a kubernetes secrets.
Setups m3 on the kubernetes deployment that we are installed to.
SetupDBAction runs all the operations to setup the DB or migrate it.
No description provided by the author
SetupNginxLoadBalancer setups the loadbalancer/reverse proxy used to resolve the tenants subdomains.
SetupPrometheusCluster performs the setup of the m3 main Prometheus cluster.
SetUserEnabled updates user's `enabled` column to the desired status True = Enabled False = Disabled.
SetUserPassword sets the password for the provided user by hashing it.
No description provided by the author
starts a loop that monitors the tasks table for pending task to schedule inside the cluster.
StopTenantServers stops MinIO servers for a particular tenant.
TenantAddAction adds a tenant to the cluster, if an admin name and email are provided, the user is created and invited via email.
No description provided by the author
UnClaimTenant unclaims a tenant on the database, marks it as available and disables it for the router.
No description provided by the author
UpdateBulkSessionStatusOnDB update multiple session status on the DB.
UpdateMinioPolicyForServiceAccount will retrieve all the permissions associated with the provided service account, build an IAM policy and submit it to the tenant's MinIO instance.
UpdateMinioServiceAccountPoliciesAndStatus Update Minio side User's Policies and Status.
UpdateNginxConfiguration Update the nginx.conf ConfigMap used by the nginx-resolver service.
UpdatePermissionDB updates Name, Description and Effect fields from the DB doing the query by ID.
No description provided by the author
UpdateServiceAccountDB updates Name from the DB doing the query by ID.
UpdateServiceAccountFields update a service account by single fields (name, enabled) and all it's corresponding permissions assigned to it.
No description provided by the author
No description provided by the author
UpdateTenantEnabledStatus changes the tenant's enabled column on the db.
UUIDsFromStringArr gets an array of strings and returns them as an array of UUIDs.
No description provided by the author
ValidateURLToken ensures Token expiration time and that it hasn't been consumed.
Validates a permission by it's id-name (slug).
Validates a service-account by it's id-name (slug).
VolumeAdd adds a new volume to a node.
WatcEtcdBucketCreation watches a key prefix on etcd for new buckets being created.
# Constants
No description provided by the author
No description provided by the author
Allowed effefcts.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Allowed effefcts.
No description provided by the author
No description provided by the author
No description provided by the author
Allowed actions.
Allowed effefcts.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Allowed actions.
Allowed actions.
No description provided by the author
No description provided by the author
Session status per mkube User.
Session status per mkube User.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
constants.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Allowed actions.
# Variables
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Config - see http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAuthentication.html.
No description provided by the author
An application wide context that holds the a transaction, in case anything goes wrong during the business logic execution, database objects can be rolled back.
No description provided by the author
No description provided by the author
EventBucketTenant stores structure parsed from etc event key.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Represents a group of machines with attached storage in which multiple storage groups reside.
Represents a logical entity in which multiple tenants resides inside a set of machines (Storage Cluster) and spawns across multiple nodes.
No description provided by the author
Struct returned by goroutines via channels that bundles a possible error.
Represents the allocation of a tenant to a specific `StorageGroup`.
Struct returned by goroutines via channels that bundles a possible error.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TenantConfiguration - holds the configuration for a Tenant.
No description provided by the author
Wraps a Tenant result with a possible error.
No description provided by the author
Wraps a Tenant result with a possible error.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
A query wrapper is a type to mark whether a query should be run inside a transaction or using only the DB.
SessionStatus - account status.
No description provided by the author