-
Notifications
You must be signed in to change notification settings - Fork 136
/
allowed_breaking_change.patch
121 lines (115 loc) · 4.47 KB
/
allowed_breaking_change.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
diff --git a/src/internet_identity/internet_identity.did b/src/internet_identity/internet_identity.did
index 500ef4d6..eb75b075 100644
--- a/src/internet_identity/internet_identity.did
+++ b/src/internet_identity/internet_identity.did
@@ -435,6 +435,17 @@ type IdentityInfoError = variant {
InternalCanisterError: text;
};
+
+
+type IdentityRegisterError = variant {
+ // No more registrations are possible in this instance of the II service canister.
+ CanisterFull;
+ // The captcha check was not successful.
+ BadCaptcha;
+ // The metadata of the provided authentication method contains invalid entries.
+ InvalidMetadata: text;
+};
+
type AuthnMethodAddError = variant {
InvalidMetadata: text;
};
@@ -521,72 +532,6 @@ type SignedIdAlias = record {
id_dapp : principal;
};
-type IdRegNextStepResult = record {
- // The next step in the registration flow
- next_step: RegistrationFlowNextStep;
-};
-
-type IdRegStartError = variant {
- // The method was called anonymously, which is not supported.
- InvalidCaller;
- // Too many registrations. Please try again later.
- RateLimitExceeded;
- // A registration flow is already in progress.
- AlreadyInProgress;
-};
-
-// The next step in the registration flow:
-// - CheckCaptcha: supply the solution to the captcha using `check_captcha`
-// - Finish: finish the registration using `identity_registration_finish`
-type RegistrationFlowNextStep = variant {
- // Supply the captcha solution using check_captcha
- CheckCaptcha: record {
- captcha_png_base64: text;
- };
- // Finish the registration using identity_registration_finish
- Finish;
-};
-
-type CheckCaptchaArg = record {
- solution : text;
-};
-
-type CheckCaptchaError = variant {
- // The supplied solution was wrong. Try again with the new captcha.
- WrongSolution: record {
- new_captcha_png_base64: text;
- };
- // This call is unexpected, see next_step.
- UnexpectedCall: record {
- next_step: RegistrationFlowNextStep;
- };
- // No registration flow ongoing for the caller.
- NoRegistrationFlow;
-};
-
-type IdRegFinishArg = record {
- authn_method: AuthnMethodData;
-};
-
-type IdRegFinishResult = record {
- identity_number: nat64;
-};
-
-type IdRegFinishError = variant {
- // The configured maximum number of identities has been reached.
- IdentityLimitReached;
- // This call is unexpected, see next_step.
- UnexpectedCall: record {
- next_step: RegistrationFlowNextStep;
- };
- // No registration flow ongoing for the caller.
- NoRegistrationFlow;
- // The supplied authn_method is not valid.
- InvalidAuthnMethod: text;
- // Error while persisting the new identity.
- StorageError: text;
-};
-
service : (opt InternetIdentityInit) -> {
// Legacy identity management API
// ==============================
@@ -613,17 +558,16 @@ service : (opt InternetIdentityInit) -> {
// V2 Identity Management API
// ==========================
- // WARNING: The following methods are experimental and may ch 0ange in the future.
-
- // Starts the identity registration flow to create a new identity.
- identity_registration_start: () -> (variant {Ok: IdRegNextStepResult; Err: IdRegStartError;});
+ // WARNING: The following methods are experimental and may change in the future.
- // Check the captcha challenge
- // If successful, the registration can be finished with `identity_registration_finish`.
- check_captcha: (CheckCaptchaArg) -> (variant {Ok: IdRegNextStepResult; Err: CheckCaptchaError;});
+ // Creates a new captcha. The solution needs to be submitted using the
+ // `identity_register` call.
+ captcha_create: () -> (variant {Ok: Challenge; Err;});
- // Starts the identity registration flow to create a new identity.
- identity_registration_finish: (IdRegFinishArg) -> (variant {Ok: IdRegFinishResult; Err: IdRegFinishError;});
+ // Registers a new identity with the given authn_method.
+ // A valid captcha solution to a previously generated captcha (using create_captcha) must be provided.
+ // The sender needs to match the supplied authn_method.
+ identity_register: (AuthnMethodData, CaptchaResult, opt principal) -> (variant {Ok: IdentityNumber; Err: IdentityRegisterError;});
// Returns information about the authentication methods of the identity with the given number.
// Only returns the minimal information required for authentication without exposing any metadata such as aliases.