Class: StrategyInstancesController
api-login/strategy/strategy-instances.controller.StrategyInstancesController
Controller for providing crud access to login strategy instances.
They can either be accessed as sub nodes of the strategy or top level
Constructors
constructor
• new StrategyInstancesController(strategiesService
, strategyInstanceService
)
Parameters
Name | Type |
---|---|
strategiesService | StrategiesService |
strategyInstanceService | StrategyInstanceService |
Defined in
gropius-login-service/backend/src/api-login/strategy/strategy-instances.controller.ts:43
Properties
logger
• Private
Readonly
logger: Logger
Defined in
gropius-login-service/backend/src/api-login/strategy/strategy-instances.controller.ts:42
strategiesService
• Private
Readonly
strategiesService: StrategiesService
Defined in
gropius-login-service/backend/src/api-login/strategy/strategy-instances.controller.ts:44
strategyInstanceService
• Private
Readonly
strategyInstanceService: StrategyInstanceService
Defined in
gropius-login-service/backend/src/api-login/strategy/strategy-instances.controller.ts:45
Methods
createNewInstance
▸ createNewInstance(input
, type?
): Promise
<StrategyInstance
>
Creates a new strategy instance.
The type of the instance is set at creation and cannot change later. The type from the url takes precedene. If that is not present, the type from the body will be used.
The required structure of the instanceConfig
is specified by the strategy.
Parameters
Name | Type | Description |
---|---|---|
input | CreateStrategyInstanceInput | The data on which to create the new strategy instance |
type? | string | The type of the new strategy instance. If not given as url parameter, must be given in the body |
Returns
Promise
<StrategyInstance
>
The created strategy instance object
Defined in
gropius-login-service/backend/src/api-login/strategy/strategy-instances.controller.ts:155
deleteStrategyInstance
▸ deleteStrategyInstance(id
, type?
): Promise
<DefaultReturn
>
Permanently deletes the login strategy instance with the given id.
Parameters
Name | Type | Description |
---|---|---|
id | string | The uuid string of the strategy instance to delete |
type? | string | The strategy type name of the strategy instance to delete |
Returns
Promise
<DefaultReturn
>
If successfull, a default response with operation "delete-strategyInstance"
Defined in
gropius-login-service/backend/src/api-login/strategy/strategy-instances.controller.ts:258
getAllStrategyInstances
▸ getAllStrategyInstances(type
): Promise
<StrategyInstance
[]>
Gets the list of all Strategy instances. If a type is specified, only the instances of that type will be retrieved.
If a non existant strategy type name ist specified, no instances will be returned.
Parameters
Name | Type | Description |
---|---|---|
type | string | The strategy type of which to request the instances. Optional. If not given, get all instances |
Returns
Promise
<StrategyInstance
[]>
A list of all instances (of the specified type)
Defined in
gropius-login-service/backend/src/api-login/strategy/strategy-instances.controller.ts:66
getStrategyInstance
▸ getStrategyInstance(id
, type?
): Promise
<StrategyInstanceDetailResponse
>
Gets one strategy instance by the specified id. If the type is specified, only instances of that type will be looked at
Parameters
Name | Type | Description |
---|---|---|
id | string | The uuid string of an existing strategy instance to get |
type? | string | The strategy type name of which to search for the instance. Defaults to all types |
Returns
Promise
<StrategyInstanceDetailResponse
>
The strategy instance with the given id (and type)
Defined in
gropius-login-service/backend/src/api-login/strategy/strategy-instances.controller.ts:102
updateStrategyInstance
▸ updateStrategyInstance(input
, id
, type?
): Promise
<StrategyInstance
>
Updates the values of an existing strategy instance.
The type can not be updated. Only values given in the body will be modified on the instance.
Parameters
Name | Type | Description |
---|---|---|
input | UpdateStrategyInstanceInput | The data to modify the strategy instance to |
id | string | The uuid string of the strategy instance to edit |
type? | string | The type the instance to modify is. Can be left out, defaults to all types. |
Returns
Promise
<StrategyInstance
>
If successful, the updated strategy instance.
Defined in
gropius-login-service/backend/src/api-login/strategy/strategy-instances.controller.ts:209