Documentation ¶
Index ¶
- Constants
- func NewApplicationError(msg string) shared.AppError
- type AppDTO
- type Application
- func (a *Application) AddScopes(newScopes []string)
- func (a *Application) AddUris(newUris []string)
- func (a *Application) IsActive() bool
- func (a *Application) RedirectUris() []string
- func (a *Application) Scopes() []string
- func (a *Application) SetScopes(scopes []string)
- func (a *Application) SetUris(uris []string)
- func (Application) TableName() string
- type CreateDTO
- type DiProvider
- type Facade
- type FindQuery
- type FindService
- type ListApplicationDTO
- type ListParams
- type Repositories
- type Repository
- type SecretModel
- type SecretQuery
- type SecretsRepository
- type Services
- type UpdateDTO
Constants ¶
View Source
const ConsoleApplicationClientId = "admin_console"
View Source
const DefaultApplicationClientId = "default"
Variables ¶
This section is empty.
Functions ¶
func NewApplicationError ¶
Types ¶
type AppDTO ¶
type AppDTO struct { Description string `json:"description"` ClientId string `json:"client_id"` State string `json:"state"` Type string `json:"type"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `json:"deleted_at"` RedirectUris []string `json:"redirect_uris"` AvailableScopes []string `json:"available_scopes"` // contains filtered or unexported fields }
func ConvertModelToDTO ¶
func ConvertModelToDTO(app *Application) *AppDTO
type Application ¶
type Application struct { ID uuid.UUID `gorm:"type:uuid;primary_key;"` CreatedAt time.Time `gorm:"type:timestamp"` UpdatedAt time.Time `gorm:"type:timestamp"` DeletedAt *time.Time `gorm:"type:timestamp"` Codename string `gorm:"varchar"` Name string `gorm:"varchar"` Type string `gorm:"varchar"` State string `gorm:"varchar"` Description string `gorm:"varchar"` ClientId string `gorm:"varchar"` RedirectUrisStr string `gorm:"type:text;column:redirect_uris"` AvailableScopesStr string `gorm:"type:text;column:available_scopes"` }
func (*Application) AddScopes ¶
func (a *Application) AddScopes(newScopes []string)
func (*Application) AddUris ¶
func (a *Application) AddUris(newUris []string)
func (*Application) IsActive ¶
func (a *Application) IsActive() bool
func (*Application) RedirectUris ¶
func (a *Application) RedirectUris() []string
func (*Application) Scopes ¶
func (a *Application) Scopes() []string
func (*Application) SetScopes ¶
func (a *Application) SetScopes(scopes []string)
func (*Application) SetUris ¶
func (a *Application) SetUris(uris []string)
func (Application) TableName ¶
func (Application) TableName() string
type CreateDTO ¶
type DiProvider ¶
type DiProvider struct { Repos Repositories Services Services Facade Facade }
func NewDiProvider ¶
func NewDiProvider(db shared.DBConnection, features *shared.FeaturesConfig) DiProvider
type Facade ¶
type Facade interface { Create(ctx context.Context, newApp *CreateDTO) (*Application, error) Update(ctx context.Context, userId uuid.UUID, newUser *UpdateDTO) (*Application, error) Delete(ctx context.Context, userId uuid.UUID) error List(ctx context.Context, listParams ListParams) ([]Application, error) Get(ctx context.Context, appId uuid.UUID) (*Application, error) GetByCodename(ctx context.Context, appId string) (*Application, error) GetByAnyId(ctx context.Context, sid string) (*Application, error) GetByClientId(ctx context.Context, sid string) (*Application, error) }
func NewApplicationsFacade ¶
func NewApplicationsFacade(apps Repository, secrets SecretsRepository, findService FindService) Facade
type FindService ¶
type FindService interface { Find(ctx context.Context, params FindQuery) ([]Application, error) FindOne(ctx context.Context, params FindQuery) (*Application, error) }
func NewFindAppsService ¶
func NewFindAppsService(repo Repository) FindService
type ListApplicationDTO ¶
type ListApplicationDTO struct {
// contains filtered or unexported fields
}
func ConvertModelsToList ¶
func ConvertModelsToList(list []Application) (result []ListApplicationDTO)
type ListParams ¶
type Repositories ¶
type Repositories struct { Apps Repository Secrets SecretsRepository }
type Repository ¶
type Repository interface { Create(ctx context.Context, app *Application) error Update(ctx context.Context, app *Application) error Delete(ctx context.Context, app *Application) error Query(ctx context.Context, query FindQuery) ([]Application, error) QueryOne(ctx context.Context, query FindQuery) (*Application, error) }
func NweApplicationsRepositoryDB ¶
func NweApplicationsRepositoryDB(db *gorm.DB) Repository
type SecretModel ¶
type SecretModel struct { ID uuid.UUID `gorm:"type:uuid;primary_key;" json:"id"` ApplicationId uuid.UUID `gorm:"type:varchar" json:"application_id"` Value string `gorm:"type:varchar" json:"value"` CreatedAt time.Time `gorm:"type:timestamp" json:"created_at"` UpdatedAt time.Time `gorm:"type:timestamp" json:"updated_at"` ExpiresAt *time.Time `gorm:"type:timestamp" json:"expires_at"` }
func (SecretModel) IsExpired ¶
func (s SecretModel) IsExpired() bool
func (SecretModel) TableName ¶
func (SecretModel) TableName() string
type SecretQuery ¶
type SecretsRepository ¶
type SecretsRepository interface { Create(ctx context.Context, secret *SecretModel) error Update(ctx context.Context, secret *SecretModel) error Delete(ctx context.Context, secret *SecretModel) error Query(ctx context.Context, query SecretQuery) ([]SecretModel, error) QueryOne(ctx context.Context, query SecretQuery) (*SecretModel, error) }
func NewSecretsRepositoryDB ¶
func NewSecretsRepositoryDB(db *gorm.DB) SecretsRepository
type Services ¶
type Services struct {
Find FindService
}
Click to show internal directories.
Click to hide internal directories.