summaryrefslogtreecommitdiff
path: root/packages/anastasis-core/src/reducer-types.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-11-04 16:53:04 +0100
committerFlorian Dold <florian@dold.me>2021-11-04 16:53:11 +0100
commit6d6679e33849d551b9da07d5058dc09c474c66b7 (patch)
tree192410793b30057a0c52612f513c007ecabbfacc /packages/anastasis-core/src/reducer-types.ts
parent83622bd65a0ebd7c22555fb2cfdb542e20d044b9 (diff)
downloadwallet-core-6d6679e33849d551b9da07d5058dc09c474c66b7.tar.gz
wallet-core-6d6679e33849d551b9da07d5058dc09c474c66b7.tar.bz2
wallet-core-6d6679e33849d551b9da07d5058dc09c474c66b7.zip
anastasis-core: support pin-type answers
Diffstat (limited to 'packages/anastasis-core/src/reducer-types.ts')
-rw-r--r--packages/anastasis-core/src/reducer-types.ts36
1 files changed, 34 insertions, 2 deletions
diff --git a/packages/anastasis-core/src/reducer-types.ts b/packages/anastasis-core/src/reducer-types.ts
index e0d311e88..19f7d431a 100644
--- a/packages/anastasis-core/src/reducer-types.ts
+++ b/packages/anastasis-core/src/reducer-types.ts
@@ -312,12 +312,44 @@ export interface ActionArgsSelectChallenge {
uuid: string;
}
-export type ActionArgsSolveChallengeRequest = SolveChallengeAnswerRequest;
-
+export type ActionArgsSolveChallengeRequest =
+ | SolveChallengeAnswerRequest
+ | SolveChallengePinRequest
+ | SolveChallengeHashRequest;
+
+/**
+ * Answer to a challenge.
+ *
+ * For "question" challenges, this is a string with the answer.
+ *
+ * For "sms" / "email" / "post" this is a numeric code with optionally
+ * the "A-" prefix.
+ */
export interface SolveChallengeAnswerRequest {
answer: string;
}
+/**
+ * Answer to a challenge that requires a numeric response.
+ *
+ * XXX: Should be deprecated in favor of just "answer".
+ */
+export interface SolveChallengePinRequest {
+ pin: number;
+}
+
+/**
+ * Answer to a challenge by directly providing the hash.
+ *
+ * XXX: When / why is this even used?
+ */
+ export interface SolveChallengeHashRequest {
+ /**
+ * Base32-crock encoded hash code.
+ */
+ hash: string;
+}
+
export interface PolicyMember {
authentication_method: number;
provider: string;