multitenancymodels

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 3 Imported by: 12

Documentation

Index

Constants

View Source
const DefaultTenantId string = "public"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIInterface

type APIInterface struct {
	LoginMethodsGET *func(tenantId string, clientType *string, options APIOptions, userContext supertokens.UserContext) (LoginMethodsGETResponse, error)
}

type APIOptions

type APIOptions struct {
	RecipeImplementation      RecipeInterface
	Config                    TypeNormalisedInput
	RecipeID                  string
	Req                       *http.Request
	Res                       http.ResponseWriter
	OtherHandler              http.HandlerFunc
	StaticThirdPartyProviders []tpmodels.ProviderInput
}

type AssociateUserToTenantResponse

type AssociateUserToTenantResponse struct {
	OK *struct {
		WasAlreadyAssociated bool
	}
	UnknownUserIdError               *struct{}
	EmailAlreadyExistsError          *struct{}
	PhoneNumberAlreadyExistsError    *struct{}
	ThirdPartyUserAlreadyExistsError *struct{}
}

type CreateOrUpdateTenantResponse

type CreateOrUpdateTenantResponse struct {
	OK *struct {
		CreatedNew bool
	}
}

type CreateOrUpdateThirdPartyConfigResponse

type CreateOrUpdateThirdPartyConfigResponse struct {
	OK *struct {
		CreatedNew bool
	}
}

type DeleteTenantResponse

type DeleteTenantResponse struct {
	OK *struct {
		DidExist bool
	}
}

type DeleteThirdPartyConfigResponse

type DeleteThirdPartyConfigResponse struct {
	OK *struct {
		DidConfigExist bool
	}
}

type DisassociateUserFromTenantResponse

type DisassociateUserFromTenantResponse struct {
	OK *struct {
		WasAssociated bool
	}
}

type ListAllTenantsResponse

type ListAllTenantsResponse struct {
	OK *struct {
		Tenants []Tenant `json:"tenants"`
	}
}

type LoginMethodsGETResponse

type LoginMethodsGETResponse struct {
	OK           *TypeLoginMethods
	GeneralError *supertokens.GeneralErrorResponse
}

type OverrideStruct

type OverrideStruct struct {
	Functions func(originalImplementation RecipeInterface) RecipeInterface
	APIs      func(originalImplementation APIInterface) APIInterface
}

type RecipeInterface

type RecipeInterface struct {
	GetTenantId *func(tenantIdFromFrontend string, userContext supertokens.UserContext) (string, error)

	// Tenant management
	CreateOrUpdateTenant *func(tenantId string, config TenantConfig, userContext supertokens.UserContext) (CreateOrUpdateTenantResponse, error)
	DeleteTenant         *func(tenantId string, userContext supertokens.UserContext) (DeleteTenantResponse, error)
	GetTenant            *func(tenantId string, userContext supertokens.UserContext) (*Tenant, error)
	ListAllTenants       *func(userContext supertokens.UserContext) (ListAllTenantsResponse, error)

	// Third party provider management
	CreateOrUpdateThirdPartyConfig *func(tenantId string, config tpmodels.ProviderConfig, skipValidation *bool, userContext supertokens.UserContext) (CreateOrUpdateThirdPartyConfigResponse, error)
	DeleteThirdPartyConfig         *func(tenantId string, thirdPartyId string, userContext supertokens.UserContext) (DeleteThirdPartyConfigResponse, error)

	// User tenant association
	AssociateUserToTenant      *func(tenantId string, userId string, userContext supertokens.UserContext) (AssociateUserToTenantResponse, error)
	DisassociateUserFromTenant *func(tenantId string, userId string, userContext supertokens.UserContext) (DisassociateUserFromTenantResponse, error)
}

type Tenant

type Tenant struct {
	TenantId      string `json:"tenantId"`
	EmailPassword struct {
		Enabled bool `json:"enabled"`
	} `json:"emailPassword"`
	Passwordless struct {
		Enabled bool `json:"enabled"`
	} `json:"passwordless"`
	ThirdParty struct {
		Enabled   bool                      `json:"enabled"`
		Providers []tpmodels.ProviderConfig `json:"providers"`
	} `json:"thirdParty"`
	CoreConfig map[string]interface{} `json:"coreConfig"`
}

type TenantConfig

type TenantConfig struct {
	EmailPasswordEnabled *bool
	PasswordlessEnabled  *bool
	ThirdPartyEnabled    *bool
	CoreConfig           map[string]interface{}
}

type TypeEmailPassword

type TypeEmailPassword struct {
	Enabled bool `json:"enabled"`
}

type TypeInput

type TypeInput struct {
	GetAllowedDomainsForTenantId func(tenantId string, userContext supertokens.UserContext) ([]string, error)
	Override                     *OverrideStruct
}

type TypeLoginMethods

type TypeLoginMethods struct {
	EmailPassword TypeEmailPassword `json:"emailPassword"`
	Passwordless  TypePasswordless  `json:"passwordless"`
	ThirdParty    TypeThirdParty    `json:"thirdParty"`
}

type TypeNormalisedInput

type TypeNormalisedInput struct {
	GetAllowedDomainsForTenantId func(tenantId string, userContext supertokens.UserContext) ([]string, error)
	Override                     OverrideStruct
}

type TypePasswordless

type TypePasswordless struct {
	Enabled bool `json:"enabled"`
}

type TypeThirdParty

type TypeThirdParty struct {
	Enabled   bool                     `json:"enabled"`
	Providers []TypeThirdPartyProvider `json:"providers"`
}

type TypeThirdPartyProvider

type TypeThirdPartyProvider struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

Jump to

Keyboard shortcuts

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