diff options
author | Sebastian <sebasjm@gmail.com> | 2021-03-03 14:43:40 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-03-03 14:43:54 -0300 |
commit | f3aea323f63199f6726583bf3f458a6134b0d9f8 (patch) | |
tree | 53f44cfa9152757b7e1939469feda709b6ecf8af /packages/frontend/src/declaration.d.ts | |
parent | 90e4e00bcfac3940475473f3a44978b89060b81e (diff) | |
download | merchant-backoffice-f3aea323f63199f6726583bf3f458a6134b0d9f8.tar.gz merchant-backoffice-f3aea323f63199f6726583bf3f458a6134b0d9f8.tar.bz2 merchant-backoffice-f3aea323f63199f6726583bf3f458a6134b0d9f8.zip |
refactor backend mutate api to use token from instance id, implemented new passwod endpoint
Diffstat (limited to 'packages/frontend/src/declaration.d.ts')
-rw-r--r-- | packages/frontend/src/declaration.d.ts | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/packages/frontend/src/declaration.d.ts b/packages/frontend/src/declaration.d.ts index a1d4b65..6a08212 100644 --- a/packages/frontend/src/declaration.d.ts +++ b/packages/frontend/src/declaration.d.ts @@ -14,10 +14,10 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ - /** - * - * @author Sebastian Javier Marchano (sebasjm) - */ +/** +* +* @author Sebastian Javier Marchano (sebasjm) +*/ @@ -101,6 +101,24 @@ export namespace MerchantBackend { } namespace Instances { + //POST /private/instances/$INSTANCE/auth + interface InstanceAuthConfigurationMessage { + // Type of authentication. + // "external": The mechant backend does not do + // any authentication checks. Instead an API + // gateway must do the authentication. + // "token": The merchant checks an auth token. + // See "token" for details. + method: "external" | "token"; + + // For method "external", this field is mandatory. + // The token MUST begin with the string "secret-token:". + // After the auth token has been set (with method "token"), + // the value must be provided in a "Authorization: Bearer $token" + // header. + token?: string; + + } //POST /private/instances interface InstanceConfigurationMessage { // The URI where the wallet will send coins. A merchant may have @@ -121,7 +139,7 @@ export namespace MerchantBackend { // Optional, if not given authentication will be disabled for // this instance (hopefully authentication checks are still // done by some reverse proxy). - auth_token?: string; + auth: InstanceAuthConfigurationMessage; // The merchant's physical address (to be put into contracts). address: Location; @@ -164,12 +182,6 @@ export namespace MerchantBackend { // Merchant name corresponding to this instance. name: string; - // "Authentication" header required to authorize management access the instance. - // Optional, if not given authentication will be disabled for - // this instance (hopefully authentication checks are still - // done by some reverse proxy). - auth_token?: string; - // The merchant's physical address (to be put into contracts). address: Location; @@ -265,6 +277,11 @@ export namespace MerchantBackend { // offers we make be valid by default? default_pay_deadline: RelativeTime; + // Authentication configuration. + // Does not contain the token when token auth is configured. + auth: { + method: "external" | "token"; + }; } interface MerchantAccount { |