diff options
author | Florian Dold <florian@dold.me> | 2021-10-18 19:18:34 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-10-18 19:18:34 +0200 |
commit | b1034801d124b53cbb683e4a430ac00c7979bca1 (patch) | |
tree | e9ff53c03369c978436af9700e2dffcc2841d111 /packages/anastasis-core/src/provider-types.ts | |
parent | 1b425294791fadda2d5751b85cda6b90a4546556 (diff) | |
download | wallet-core-b1034801d124b53cbb683e4a430ac00c7979bca1.tar.xz |
reducer implementation WIP
Diffstat (limited to 'packages/anastasis-core/src/provider-types.ts')
-rw-r--r-- | packages/anastasis-core/src/provider-types.ts | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/packages/anastasis-core/src/provider-types.ts b/packages/anastasis-core/src/provider-types.ts new file mode 100644 index 000000000..b477c09b9 --- /dev/null +++ b/packages/anastasis-core/src/provider-types.ts @@ -0,0 +1,74 @@ +import { AmountString } from "@gnu-taler/taler-util"; + +export interface EscrowConfigurationResponse { + // Protocol identifier, clarifies that this is an Anastasis provider. + name: "anastasis"; + + // libtool-style representation of the Exchange protocol version, see + // https://www.gnu.org/software/libtool/manual/html_node/Versioning.html#Versioning + // The format is "current:revision:age". + version: string; + + // Currency in which this provider processes payments. + currency: string; + + // Supported authorization methods. + methods: AuthorizationMethodConfig[]; + + // Maximum policy upload size supported. + storage_limit_in_megabytes: number; + + // Payment required to maintain an account to store policy documents for a year. + // Users can pay more, in which case the storage time will go up proportionally. + annual_fee: AmountString; + + // Payment required to upload truth. To be paid per upload. + truth_upload_fee: AmountString; + + // Limit on the liability that the provider is offering with + // respect to the services provided. + liability_limit: AmountString; + + // Salt value with 128 bits of entropy. + // Different providers + // will use different high-entropy salt values. The resulting + // **provider salt** is then used in various operations to ensure + // cryptographic operations differ by provider. A provider must + // never change its salt value. + server_salt: string; + + business_name: string; +} + +export interface AuthorizationMethodConfig { + // Name of the authorization method. + type: string; + + // Fee for accessing key share using this method. + cost: AmountString; +} + +export interface TruthUploadRequest { + // Contains the information of an interface EncryptedKeyShare, but simply + // as one binary block (in Crockford Base32 encoding for JSON). + key_share_data: string; + + // Key share method, i.e. "security question", "SMS", "e-mail", ... + type: string; + + // Variable-size truth. After decryption, + // this contains the ground truth, i.e. H(challenge answer), + // phone number, e-mail address, picture, fingerprint, ... + // **base32 encoded**. + // + // The nonce of the HKDF for this encryption must include the + // string "ECT". + encrypted_truth: string; //bytearray + + // MIME type of truth, i.e. text/ascii, image/jpeg, etc. + truth_mime?: string; + + // For how many years from now would the client like us to + // store the truth? + storage_duration_years: number; +} |