@colveor/admin 0.0.0-stage → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +106 -0
- package/README.md +365 -2
- package/TAILWINDADMIN-LICENSE +21 -0
- package/dist/account/data.d.ts +1 -0
- package/dist/account/data.js +44 -0
- package/dist/account/profile.d.ts +6 -0
- package/dist/account/profile.js +118 -0
- package/dist/account/sessions.d.ts +1 -0
- package/dist/account/sessions.js +26 -0
- package/dist/account/shared.d.ts +26 -0
- package/dist/account/shared.js +44 -0
- package/dist/account/two-factor.d.ts +5 -0
- package/dist/account/two-factor.js +60 -0
- package/dist/actions.d.ts +39 -0
- package/dist/actions.js +81 -0
- package/dist/api/audit.gen.d.ts +80 -0
- package/dist/api/audit.gen.js +43 -0
- package/dist/api/auth.gen.d.ts +537 -0
- package/dist/api/auth.gen.js +313 -0
- package/dist/api/errors.gen.d.ts +16 -0
- package/dist/api/errors.gen.js +2 -0
- package/dist/api/gormx.gen.d.ts +60 -0
- package/dist/api/gormx.gen.js +16 -0
- package/dist/api/health.gen.d.ts +103 -0
- package/dist/api/health.gen.js +23 -0
- package/dist/api/index.gen.d.ts +21 -0
- package/dist/api/index.gen.js +22 -0
- package/dist/api/invitations.gen.d.ts +128 -0
- package/dist/api/invitations.gen.js +57 -0
- package/dist/api/ledger.gen.d.ts +269 -0
- package/dist/api/ledger.gen.js +113 -0
- package/dist/api/msgtemplate.gen.d.ts +31 -0
- package/dist/api/msgtemplate.gen.js +2 -0
- package/dist/api/notifications.gen.d.ts +66 -0
- package/dist/api/notifications.gen.js +28 -0
- package/dist/api/outbox.gen.d.ts +8 -0
- package/dist/api/outbox.gen.js +2 -0
- package/dist/api/queue.gen.d.ts +112 -0
- package/dist/api/queue.gen.js +15 -0
- package/dist/api/rbac.gen.d.ts +406 -0
- package/dist/api/rbac.gen.js +191 -0
- package/dist/api/reauth.gen.d.ts +289 -0
- package/dist/api/reauth.gen.js +122 -0
- package/dist/api/recorded_payments.gen.d.ts +171 -0
- package/dist/api/recorded_payments.gen.js +79 -0
- package/dist/api/sessions.gen.d.ts +64 -0
- package/dist/api/sessions.gen.js +48 -0
- package/dist/api/settings.gen.d.ts +147 -0
- package/dist/api/settings.gen.js +69 -0
- package/dist/api/storage.gen.d.ts +327 -0
- package/dist/api/storage.gen.js +208 -0
- package/dist/api/support_access.gen.d.ts +155 -0
- package/dist/api/support_access.gen.js +131 -0
- package/dist/api/users.gen.d.ts +407 -0
- package/dist/api/users.gen.js +159 -0
- package/dist/api/verification.gen.d.ts +427 -0
- package/dist/api/verification.gen.js +280 -0
- package/dist/api/webhooks.gen.d.ts +110 -0
- package/dist/api/webhooks.gen.js +45 -0
- package/dist/auth-layout.d.ts +9 -0
- package/dist/auth-layout.js +5 -0
- package/dist/banner.d.ts +1 -0
- package/dist/banner.js +49 -0
- package/dist/client.d.ts +41 -0
- package/dist/client.js +72 -0
- package/dist/config.d.ts +27 -0
- package/dist/config.js +82 -0
- package/dist/dates.d.ts +4 -0
- package/dist/dates.js +16 -0
- package/dist/header.d.ts +12 -0
- package/dist/header.js +105 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +15 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +42 -0
- package/dist/kit/avatar.d.ts +5 -0
- package/dist/kit/avatar.js +16 -0
- package/dist/kit/badge.d.ts +10 -0
- package/dist/kit/badge.js +31 -0
- package/dist/kit/card.d.ts +12 -0
- package/dist/kit/card.js +7 -0
- package/dist/kit/code-area.d.ts +15 -0
- package/dist/kit/code-area.js +69 -0
- package/dist/kit/dropdown.d.ts +26 -0
- package/dist/kit/dropdown.js +67 -0
- package/dist/kit/filter-tabs.d.ts +9 -0
- package/dist/kit/filter-tabs.js +7 -0
- package/dist/kit/modal.d.ts +8 -0
- package/dist/kit/modal.js +15 -0
- package/dist/kit/page-header.d.ts +13 -0
- package/dist/kit/page-header.js +13 -0
- package/dist/kit/search.d.ts +4 -0
- package/dist/kit/search.js +16 -0
- package/dist/kit/tooltip.d.ts +17 -0
- package/dist/kit/tooltip.js +52 -0
- package/dist/message-editor.d.ts +9 -0
- package/dist/message-editor.js +80 -0
- package/dist/money.d.ts +10 -0
- package/dist/money.js +17 -0
- package/dist/next.d.ts +6 -0
- package/dist/next.js +19 -0
- package/dist/pages/account.d.ts +1 -0
- package/dist/pages/account.js +47 -0
- package/dist/pages/audit.d.ts +1 -0
- package/dist/pages/audit.js +88 -0
- package/dist/pages/forgot-password.d.ts +1 -0
- package/dist/pages/forgot-password.js +73 -0
- package/dist/pages/ledger.d.ts +1 -0
- package/dist/pages/ledger.js +132 -0
- package/dist/pages/roles.d.ts +1 -0
- package/dist/pages/roles.js +102 -0
- package/dist/pages/settings.d.ts +1 -0
- package/dist/pages/settings.js +86 -0
- package/dist/pages/sign-in.d.ts +5 -0
- package/dist/pages/sign-in.js +117 -0
- package/dist/pages/status.d.ts +1 -0
- package/dist/pages/status.js +122 -0
- package/dist/pages/support.d.ts +1 -0
- package/dist/pages/support.js +90 -0
- package/dist/pages/teams.d.ts +1 -0
- package/dist/pages/teams.js +94 -0
- package/dist/pages/users.d.ts +1 -0
- package/dist/pages/users.js +158 -0
- package/dist/pages/webhooks.d.ts +1 -0
- package/dist/pages/webhooks.js +88 -0
- package/dist/permissions.d.ts +5 -0
- package/dist/permissions.js +31 -0
- package/dist/proof.d.ts +10 -0
- package/dist/proof.js +78 -0
- package/dist/proxy.d.ts +10 -0
- package/dist/proxy.js +166 -0
- package/dist/retry.d.ts +8 -0
- package/dist/retry.js +30 -0
- package/dist/router.d.ts +13 -0
- package/dist/router.js +14 -0
- package/dist/setting-fields.d.ts +12 -0
- package/dist/setting-fields.js +102 -0
- package/dist/setting-list.d.ts +22 -0
- package/dist/setting-list.js +78 -0
- package/dist/shell.d.ts +40 -0
- package/dist/shell.js +97 -0
- package/dist/support.d.ts +37 -0
- package/dist/support.js +76 -0
- package/dist/table.d.ts +40 -0
- package/dist/table.js +73 -0
- package/dist/ui.d.ts +39 -0
- package/dist/ui.js +56 -0
- package/dist/user-actions.d.ts +30 -0
- package/dist/user-actions.js +129 -0
- package/dist/user-roles.d.ts +4 -0
- package/dist/user-roles.js +51 -0
- package/dist/user-row-menu.d.ts +14 -0
- package/dist/user-row-menu.js +45 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +3 -0
- package/package.json +63 -4
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// Code generated by tygo. DO NOT EDIT.
|
|
2
|
+
//////////
|
|
3
|
+
// source: actions.go
|
|
4
|
+
/**
|
|
5
|
+
* Actions recorded in the audit log (section 42.1), with the change, in its
|
|
6
|
+
* transaction. rbac.AccessDenied is declared in platform/rbac.
|
|
7
|
+
*/
|
|
8
|
+
export const ActionRoleCreated = "rbac.RoleCreated";
|
|
9
|
+
/**
|
|
10
|
+
* Actions recorded in the audit log (section 42.1), with the change, in its
|
|
11
|
+
* transaction. rbac.AccessDenied is declared in platform/rbac.
|
|
12
|
+
*/
|
|
13
|
+
export const ActionRoleUpdated = "rbac.RoleUpdated";
|
|
14
|
+
/**
|
|
15
|
+
* Actions recorded in the audit log (section 42.1), with the change, in its
|
|
16
|
+
* transaction. rbac.AccessDenied is declared in platform/rbac.
|
|
17
|
+
*/
|
|
18
|
+
export const ActionRoleDeleted = "rbac.RoleDeleted";
|
|
19
|
+
/**
|
|
20
|
+
* Actions recorded in the audit log (section 42.1), with the change, in its
|
|
21
|
+
* transaction. rbac.AccessDenied is declared in platform/rbac.
|
|
22
|
+
*/
|
|
23
|
+
export const ActionRolePermissionsChanged = "rbac.RolePermissionsChanged";
|
|
24
|
+
/**
|
|
25
|
+
* Actions recorded in the audit log (section 42.1), with the change, in its
|
|
26
|
+
* transaction. rbac.AccessDenied is declared in platform/rbac.
|
|
27
|
+
*/
|
|
28
|
+
export const ActionUserRolesChanged = "rbac.UserRolesChanged";
|
|
29
|
+
/**
|
|
30
|
+
* Actions recorded in the audit log (section 42.1), with the change, in its
|
|
31
|
+
* transaction. rbac.AccessDenied is declared in platform/rbac.
|
|
32
|
+
*/
|
|
33
|
+
export const ActionDefaultRoleChanged = "rbac.DefaultRoleChanged";
|
|
34
|
+
/**
|
|
35
|
+
* Actions recorded in the audit log (section 42.1), with the change, in its
|
|
36
|
+
* transaction. rbac.AccessDenied is declared in platform/rbac.
|
|
37
|
+
*/
|
|
38
|
+
export const ActionTeamSuspended = "rbac.TeamSuspended";
|
|
39
|
+
/**
|
|
40
|
+
* Actions recorded in the audit log (section 42.1), with the change, in its
|
|
41
|
+
* transaction. rbac.AccessDenied is declared in platform/rbac.
|
|
42
|
+
*/
|
|
43
|
+
export const ActionTeamReactivated = "rbac.TeamReactivated";
|
|
44
|
+
/**
|
|
45
|
+
* Team statuses (docs/team-status.md).
|
|
46
|
+
*/
|
|
47
|
+
export const TeamActive = "active";
|
|
48
|
+
/**
|
|
49
|
+
* Team statuses (docs/team-status.md).
|
|
50
|
+
*/
|
|
51
|
+
export const TeamSuspended = "suspended";
|
|
52
|
+
//////////
|
|
53
|
+
// source: errors.go
|
|
54
|
+
/**
|
|
55
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
56
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
57
|
+
*/
|
|
58
|
+
export const ErrCodeRoleNotFound = "rbac.role_not_found";
|
|
59
|
+
/**
|
|
60
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
61
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
62
|
+
*/
|
|
63
|
+
export const ErrCodeRoleExists = "rbac.role_exists";
|
|
64
|
+
/**
|
|
65
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
66
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
67
|
+
*/
|
|
68
|
+
export const ErrCodeInvalidSlug = "rbac.invalid_slug";
|
|
69
|
+
/**
|
|
70
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
71
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
72
|
+
*/
|
|
73
|
+
export const ErrCodeSystemRole = "rbac.system_role";
|
|
74
|
+
/**
|
|
75
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
76
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
77
|
+
*/
|
|
78
|
+
export const ErrCodeDefaultRole = "rbac.default_role";
|
|
79
|
+
/**
|
|
80
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
81
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
82
|
+
*/
|
|
83
|
+
export const ErrCodeNoRoles = "rbac.no_roles";
|
|
84
|
+
/**
|
|
85
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
86
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
87
|
+
*/
|
|
88
|
+
export const ErrCodeHierarchy = "rbac.hierarchy";
|
|
89
|
+
/**
|
|
90
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
91
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
92
|
+
*/
|
|
93
|
+
export const ErrCodeProtectedUser = "rbac.protected_user";
|
|
94
|
+
/**
|
|
95
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
96
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
97
|
+
*/
|
|
98
|
+
export const ErrCodeInvalidLevel = "rbac.invalid_level";
|
|
99
|
+
/**
|
|
100
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
101
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
102
|
+
*/
|
|
103
|
+
export const ErrCodeUnknownPermission = "rbac.unknown_permission";
|
|
104
|
+
/**
|
|
105
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
106
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
107
|
+
*/
|
|
108
|
+
export const ErrCodeUnknownRole = "rbac.unknown_role";
|
|
109
|
+
/**
|
|
110
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
111
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
112
|
+
*/
|
|
113
|
+
export const ErrCodeEscalation = "rbac.escalation";
|
|
114
|
+
/**
|
|
115
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
116
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
117
|
+
*/
|
|
118
|
+
export const ErrCodeLastSuperAdmin = "rbac.last_super_admin";
|
|
119
|
+
/**
|
|
120
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
121
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
122
|
+
*/
|
|
123
|
+
export const ErrCodeUserNotFound = "rbac.user_not_found";
|
|
124
|
+
/**
|
|
125
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
126
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
127
|
+
*/
|
|
128
|
+
export const ErrCodeInternal = "rbac.internal";
|
|
129
|
+
/**
|
|
130
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
131
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
132
|
+
*/
|
|
133
|
+
export const ErrCodeSuspendedAbove = "rbac.team_suspended_above";
|
|
134
|
+
/**
|
|
135
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
136
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
137
|
+
*/
|
|
138
|
+
export const ErrCodeTooManyUsers = "rbac.too_many_users";
|
|
139
|
+
/**
|
|
140
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
141
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
142
|
+
*/
|
|
143
|
+
export const ErrCodeTeamSuspended = "rbac.team_suspended";
|
|
144
|
+
/**
|
|
145
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
146
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
147
|
+
*/
|
|
148
|
+
export const ErrCodeForbidden = "rbac.forbidden";
|
|
149
|
+
/**
|
|
150
|
+
* Stable error codes (section 42.5). rbac.forbidden and rbac.token_stale
|
|
151
|
+
* are defined by platform/rbac, which returns them from Require.
|
|
152
|
+
*/
|
|
153
|
+
export const ErrCodeTokenStale = "rbac.token_stale";
|
|
154
|
+
//////////
|
|
155
|
+
// source: permissions.go
|
|
156
|
+
/**
|
|
157
|
+
* Permissions this module guards (section 25.1). rbac.manage has no default
|
|
158
|
+
* role: only super_admin (which grants everything) holds it until an
|
|
159
|
+
* operator grants it to another role.
|
|
160
|
+
*/
|
|
161
|
+
export const PermissionRead = "rbac.read";
|
|
162
|
+
/**
|
|
163
|
+
* Permissions this module guards (section 25.1). rbac.manage has no default
|
|
164
|
+
* role: only super_admin (which grants everything) holds it until an
|
|
165
|
+
* operator grants it to another role.
|
|
166
|
+
*/
|
|
167
|
+
export const PermissionManage = "rbac.manage";
|
|
168
|
+
/**
|
|
169
|
+
* PermissionSuspendTeams lets a platform admin suspend and reactivate
|
|
170
|
+
* teams (docs/team-status.md), and see which are suspended.
|
|
171
|
+
*/
|
|
172
|
+
export const PermissionSuspendTeams = "teams.suspend";
|
|
173
|
+
/**
|
|
174
|
+
* Team audit actions.
|
|
175
|
+
*/
|
|
176
|
+
export const ActionTeamRoleAssigned = "rbac.TeamRoleAssigned";
|
|
177
|
+
/**
|
|
178
|
+
* Team audit actions.
|
|
179
|
+
*/
|
|
180
|
+
export const ActionTeamRoleChanged = "rbac.TeamRoleChanged";
|
|
181
|
+
/**
|
|
182
|
+
* Team audit actions.
|
|
183
|
+
*/
|
|
184
|
+
export const ActionTeamRoleRemoved = "rbac.TeamRoleRemoved";
|
|
185
|
+
/**
|
|
186
|
+
* Team audit actions.
|
|
187
|
+
*/
|
|
188
|
+
export const ActionTeamDeleted = "rbac.TeamDeleted";
|
|
189
|
+
export const ErrCodeLastHolder = "rbac.last_holder";
|
|
190
|
+
export const ErrCodeRoleNotAssignable = "rbac.role_not_assignable";
|
|
191
|
+
export const ErrCodeOwnRole = "rbac.own_role";
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import type * as verification from "./verification.gen";
|
|
2
|
+
/**
|
|
3
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
4
|
+
* the action name with outcome failure and the error code as reason.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ActionReauthenticated = "reauth.Reauthenticated";
|
|
7
|
+
/**
|
|
8
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
9
|
+
* the action name with outcome failure and the error code as reason.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ActionSecondFactorVerified = "reauth.SecondFactorVerified";
|
|
12
|
+
/**
|
|
13
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
14
|
+
* the action name with outcome failure and the error code as reason.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ActionTwoFactorEnabled = "reauth.TwoFactorEnabled";
|
|
17
|
+
/**
|
|
18
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
19
|
+
* the action name with outcome failure and the error code as reason.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ActionTwoFactorDisabled = "reauth.TwoFactorDisabled";
|
|
22
|
+
/**
|
|
23
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
24
|
+
* the action name with outcome failure and the error code as reason.
|
|
25
|
+
*/
|
|
26
|
+
export declare const ActionPINSet = "reauth.PINSet";
|
|
27
|
+
/**
|
|
28
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
29
|
+
* the action name with outcome failure and the error code as reason.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ActionAuthenticatorAdded = "reauth.AuthenticatorAdded";
|
|
32
|
+
/**
|
|
33
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
34
|
+
* the action name with outcome failure and the error code as reason.
|
|
35
|
+
*/
|
|
36
|
+
export declare const ActionAuthenticatorRemoved = "reauth.AuthenticatorRemoved";
|
|
37
|
+
/**
|
|
38
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
39
|
+
* the action name with outcome failure and the error code as reason.
|
|
40
|
+
*/
|
|
41
|
+
export declare const ActionBiometricKeyAdded = "reauth.BiometricKeyAdded";
|
|
42
|
+
/**
|
|
43
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
44
|
+
* the action name with outcome failure and the error code as reason.
|
|
45
|
+
*/
|
|
46
|
+
export declare const ActionBiometricKeyRemoved = "reauth.BiometricKeyRemoved";
|
|
47
|
+
/**
|
|
48
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
49
|
+
* the action name with outcome failure and the error code as reason.
|
|
50
|
+
*/
|
|
51
|
+
export declare const ActionRecoveryCodesRegenerated = "reauth.RecoveryCodesRegenerated";
|
|
52
|
+
/**
|
|
53
|
+
* An admin's, on another user (docs/user-admin.md).
|
|
54
|
+
*/
|
|
55
|
+
export declare const ActionTwoFactorReset = "reauth.TwoFactorReset";
|
|
56
|
+
/**
|
|
57
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
58
|
+
* the action name with outcome failure and the error code as reason.
|
|
59
|
+
*/
|
|
60
|
+
export declare const ActionPINUnlocked = "reauth.PINUnlocked";
|
|
61
|
+
/**
|
|
62
|
+
* Proof is how the user shows it's them. The field to fill depends on
|
|
63
|
+
* Method:
|
|
64
|
+
* - password: Password;
|
|
65
|
+
* - email_code, phone_code: VerificationToken, from verifying a code sent
|
|
66
|
+
* with purpose "reauth" to the account's verified email or phone (see
|
|
67
|
+
* SendCode);
|
|
68
|
+
* - auth_pin, transaction_pin: PIN;
|
|
69
|
+
* - totp: Code, from the authenticator app;
|
|
70
|
+
* - recovery_code: RecoveryCode, one of the codes given when two-factor
|
|
71
|
+
* sign-in was turned on (case and dashes do not matter);
|
|
72
|
+
* - biometric: Challenge (from POST /challenges, which names the key)
|
|
73
|
+
* and Signature, the biometric key's ECDSA P-256 SHA-256 signature of the
|
|
74
|
+
* challenge string, ASN.1 DER, base64.
|
|
75
|
+
*/
|
|
76
|
+
export interface Proof {
|
|
77
|
+
method: string;
|
|
78
|
+
password?: string;
|
|
79
|
+
verification_token?: string;
|
|
80
|
+
pin?: string;
|
|
81
|
+
code?: string;
|
|
82
|
+
challenge?: string;
|
|
83
|
+
signature?: string;
|
|
84
|
+
recovery_code?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* CreateTokenRequest re-authenticates for Action.
|
|
88
|
+
*/
|
|
89
|
+
export interface CreateTokenRequest extends Proof {
|
|
90
|
+
action: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* SendCodeRequest sends a reauth code to the account's own verified email
|
|
94
|
+
* or phone, for the email_code or phone_code method.
|
|
95
|
+
*/
|
|
96
|
+
export interface SendCodeRequest {
|
|
97
|
+
channel: verification.Channel;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* TOTPSetupResponse starts adding an authenticator app: show URL as a QR
|
|
101
|
+
* code (or Secret for manual entry), then confirm with a first code within
|
|
102
|
+
* 10 minutes.
|
|
103
|
+
*/
|
|
104
|
+
export interface TOTPSetupResponse {
|
|
105
|
+
secret: string;
|
|
106
|
+
otpauth_url: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* ConfirmTOTPRequest finishes adding the authenticator app.
|
|
110
|
+
*/
|
|
111
|
+
export interface ConfirmTOTPRequest {
|
|
112
|
+
code: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* SetTwoFactorRequest turns two-factor sign-in on or off.
|
|
116
|
+
*/
|
|
117
|
+
export interface SetTwoFactorRequest {
|
|
118
|
+
enabled?: boolean;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* TwoFactorResponse reports the new state. SignedOut is true when turning
|
|
122
|
+
* it on signed out every session, this one included: sign in again with
|
|
123
|
+
* two factors.
|
|
124
|
+
*/
|
|
125
|
+
export interface TwoFactorResponse {
|
|
126
|
+
enabled: boolean;
|
|
127
|
+
signed_out: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* RecoveryCodes are shown once, when two-factor sign-in is turned on:
|
|
130
|
+
* the user saves them to sign in if they lose their second factor.
|
|
131
|
+
*/
|
|
132
|
+
recovery_codes?: string[];
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* RecoveryCodesResponse is a new set of recovery codes, replacing the old
|
|
136
|
+
* ones. They are shown once.
|
|
137
|
+
*/
|
|
138
|
+
export interface RecoveryCodesResponse {
|
|
139
|
+
recovery_codes: string[];
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* MFATokenRequest identifies a sign-in waiting for its second factor (the
|
|
143
|
+
* mfa_token from the first factor).
|
|
144
|
+
*/
|
|
145
|
+
export interface MFATokenRequest {
|
|
146
|
+
mfa_token: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* MFASendCodeRequest sends a code for the second factor.
|
|
150
|
+
*/
|
|
151
|
+
export interface MFASendCodeRequest extends MFATokenRequest, SendCodeRequest {
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* VerifyTwoFactorRequest finishes a two-factor sign-in.
|
|
155
|
+
*/
|
|
156
|
+
export interface VerifyTwoFactorRequest extends MFATokenRequest, Proof {
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* MFAChallengeRequest gets a biometric challenge for the second factor.
|
|
160
|
+
*/
|
|
161
|
+
export interface MFAChallengeRequest extends MFATokenRequest, ChallengeRequest {
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* AddBiometricKeyRequest registers a phone's biometric key. PublicKey is the
|
|
165
|
+
* P-256 public key, base64: PKIX DER (Android getEncoded) or the raw
|
|
166
|
+
* 65-byte uncompressed point (iOS SecKeyCopyExternalRepresentation).
|
|
167
|
+
*/
|
|
168
|
+
export interface AddBiometricKeyRequest {
|
|
169
|
+
name: string;
|
|
170
|
+
public_key: string;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* BiometricKeyResponse is a registered biometric key. LastUsedAt is nil until it first
|
|
174
|
+
* signs a challenge.
|
|
175
|
+
*/
|
|
176
|
+
export interface BiometricKeyResponse {
|
|
177
|
+
id: string;
|
|
178
|
+
name: string;
|
|
179
|
+
created_at: string;
|
|
180
|
+
last_used_at?: string;
|
|
181
|
+
}
|
|
182
|
+
export interface BiometricKeysResponse {
|
|
183
|
+
keys: BiometricKeyResponse[];
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* ChallengeRequest names the biometric key that will sign the challenge.
|
|
187
|
+
*/
|
|
188
|
+
export interface ChallengeRequest {
|
|
189
|
+
key_id: string;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* ChallengeResponse is a single-use challenge for the phone to sign with the key,
|
|
193
|
+
* valid until ExpiresAt (Unix milliseconds).
|
|
194
|
+
*/
|
|
195
|
+
export interface ChallengeResponse {
|
|
196
|
+
challenge: string;
|
|
197
|
+
expires_at: number;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* PINType names a PIN. The auth PIN confirms everyday account actions; the
|
|
201
|
+
* transaction PIN is kept for very sensitive ones, such as moving money, so
|
|
202
|
+
* knowing one does not give the other.
|
|
203
|
+
*/
|
|
204
|
+
export type PINType = string;
|
|
205
|
+
export declare const PINAuth: PINType;
|
|
206
|
+
export declare const PINTransaction: PINType;
|
|
207
|
+
/**
|
|
208
|
+
* ActionManageSecurity is the re-authentication action for changing how
|
|
209
|
+
* the account confirms it's you, such as setting a PIN.
|
|
210
|
+
*/
|
|
211
|
+
export declare const ActionManageSecurity = "manage_security";
|
|
212
|
+
/**
|
|
213
|
+
* StepUpResetTwoFactor is the re-authentication an admin needs to reset
|
|
214
|
+
* another user's two-factor sign-in: whoever can, and knows the password,
|
|
215
|
+
* can take the account over.
|
|
216
|
+
*/
|
|
217
|
+
export declare const StepUpResetTwoFactor = "reset_user_2fa";
|
|
218
|
+
/**
|
|
219
|
+
* SetPINRequest sets, changes or resets a PIN. Its length must match the
|
|
220
|
+
* setting for the PIN type (reauth.pin.<type>.length).
|
|
221
|
+
*/
|
|
222
|
+
export interface SetPINRequest {
|
|
223
|
+
pin: string;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* SetPINResponse confirms which PIN was set.
|
|
227
|
+
*/
|
|
228
|
+
export interface SetPINResponse {
|
|
229
|
+
type: PINType;
|
|
230
|
+
success: boolean;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* TokenResponse carries the reauth token. Send it in the X-Reauth-Token
|
|
234
|
+
* header of the protected request; it works once, before ExpiresAt (Unix
|
|
235
|
+
* milliseconds).
|
|
236
|
+
*/
|
|
237
|
+
export interface TokenResponse {
|
|
238
|
+
reauth_token: string;
|
|
239
|
+
action: string;
|
|
240
|
+
method: string;
|
|
241
|
+
expires_at: number;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* MethodsResponse lists the methods the user can use now.
|
|
245
|
+
*/
|
|
246
|
+
export interface MethodsResponse {
|
|
247
|
+
methods: string[];
|
|
248
|
+
}
|
|
249
|
+
export declare const ErrCodeUnauthenticated = "reauth.unauthenticated";
|
|
250
|
+
export declare const ErrCodeInvalidProof = "reauth.invalid_proof";
|
|
251
|
+
export declare const ErrCodeMethodUnavailable = "reauth.method_unavailable";
|
|
252
|
+
export declare const ErrCodeLocked = "reauth.locked";
|
|
253
|
+
export declare const ErrCodePINLocked = "reauth.pin_locked";
|
|
254
|
+
export declare const ErrCodeInvalidPIN = "reauth.invalid_pin";
|
|
255
|
+
export declare const ErrCodeNoTOTPSetup = "reauth.no_totp_setup";
|
|
256
|
+
export declare const ErrCodeNotEnoughMethods = "reauth.not_enough_methods";
|
|
257
|
+
export declare const ErrCodeSameFactor = "reauth.same_factor";
|
|
258
|
+
export declare const ErrCodeLastMethod = "reauth.last_method";
|
|
259
|
+
export declare const ErrCodeBiometricKeyNotFound = "reauth.biometric_key_not_found";
|
|
260
|
+
export declare const ErrCodeInvalidPublicKey = "reauth.invalid_public_key";
|
|
261
|
+
export declare const ErrCodeTwoFactorOff = "reauth.two_factor_off";
|
|
262
|
+
/**
|
|
263
|
+
* An admin's actions on another user's second factors (docs/user-admin.md).
|
|
264
|
+
* Keys name the users they act on, though this module guards them.
|
|
265
|
+
*/
|
|
266
|
+
export declare const PermissionResetTwoFactor: string;
|
|
267
|
+
/**
|
|
268
|
+
* An admin's actions on another user's second factors (docs/user-admin.md).
|
|
269
|
+
* Keys name the users they act on, though this module guards them.
|
|
270
|
+
*/
|
|
271
|
+
export declare const PermissionUnlockPIN: string;
|
|
272
|
+
/**
|
|
273
|
+
* RateLimitTokens limits creating reauth tokens and sending reauth
|
|
274
|
+
* codes, per signed-in user.
|
|
275
|
+
*/
|
|
276
|
+
export declare const RateLimitTokens = "reauth.tokens";
|
|
277
|
+
/**
|
|
278
|
+
* RateLimitTwoFactor limits the public two-factor sign-in calls per
|
|
279
|
+
* pending sign-in (mfa_token), on top of each method's own lockout.
|
|
280
|
+
*/
|
|
281
|
+
export declare const RateLimitTwoFactor = "reauth.two_factor";
|
|
282
|
+
export type Service = unknown;
|
|
283
|
+
export declare const SettingTokenTTLSeconds: string;
|
|
284
|
+
export declare const SettingMaxFailures: string;
|
|
285
|
+
export declare const SettingLockoutSeconds: string;
|
|
286
|
+
export declare const SettingAuthPINLength: string;
|
|
287
|
+
export declare const SettingAuthPINMaxAttempts: string;
|
|
288
|
+
export declare const SettingTransactionPINLength: string;
|
|
289
|
+
export declare const SettingTransactionPINMaxAttempts: string;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
//////////
|
|
2
|
+
// source: actions.go
|
|
3
|
+
/**
|
|
4
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
5
|
+
* the action name with outcome failure and the error code as reason.
|
|
6
|
+
*/
|
|
7
|
+
export const ActionReauthenticated = "reauth.Reauthenticated";
|
|
8
|
+
/**
|
|
9
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
10
|
+
* the action name with outcome failure and the error code as reason.
|
|
11
|
+
*/
|
|
12
|
+
export const ActionSecondFactorVerified = "reauth.SecondFactorVerified";
|
|
13
|
+
/**
|
|
14
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
15
|
+
* the action name with outcome failure and the error code as reason.
|
|
16
|
+
*/
|
|
17
|
+
export const ActionTwoFactorEnabled = "reauth.TwoFactorEnabled";
|
|
18
|
+
/**
|
|
19
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
20
|
+
* the action name with outcome failure and the error code as reason.
|
|
21
|
+
*/
|
|
22
|
+
export const ActionTwoFactorDisabled = "reauth.TwoFactorDisabled";
|
|
23
|
+
/**
|
|
24
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
25
|
+
* the action name with outcome failure and the error code as reason.
|
|
26
|
+
*/
|
|
27
|
+
export const ActionPINSet = "reauth.PINSet";
|
|
28
|
+
/**
|
|
29
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
30
|
+
* the action name with outcome failure and the error code as reason.
|
|
31
|
+
*/
|
|
32
|
+
export const ActionAuthenticatorAdded = "reauth.AuthenticatorAdded";
|
|
33
|
+
/**
|
|
34
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
35
|
+
* the action name with outcome failure and the error code as reason.
|
|
36
|
+
*/
|
|
37
|
+
export const ActionAuthenticatorRemoved = "reauth.AuthenticatorRemoved";
|
|
38
|
+
/**
|
|
39
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
40
|
+
* the action name with outcome failure and the error code as reason.
|
|
41
|
+
*/
|
|
42
|
+
export const ActionBiometricKeyAdded = "reauth.BiometricKeyAdded";
|
|
43
|
+
/**
|
|
44
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
45
|
+
* the action name with outcome failure and the error code as reason.
|
|
46
|
+
*/
|
|
47
|
+
export const ActionBiometricKeyRemoved = "reauth.BiometricKeyRemoved";
|
|
48
|
+
/**
|
|
49
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
50
|
+
* the action name with outcome failure and the error code as reason.
|
|
51
|
+
*/
|
|
52
|
+
export const ActionRecoveryCodesRegenerated = "reauth.RecoveryCodesRegenerated";
|
|
53
|
+
/**
|
|
54
|
+
* An admin's, on another user (docs/user-admin.md).
|
|
55
|
+
*/
|
|
56
|
+
export const ActionTwoFactorReset = "reauth.TwoFactorReset";
|
|
57
|
+
/**
|
|
58
|
+
* Actions recorded in the audit log (section 42.1). A refused attempt keeps
|
|
59
|
+
* the action name with outcome failure and the error code as reason.
|
|
60
|
+
*/
|
|
61
|
+
export const ActionPINUnlocked = "reauth.PINUnlocked";
|
|
62
|
+
export const PINAuth = "auth";
|
|
63
|
+
export const PINTransaction = "transaction";
|
|
64
|
+
/**
|
|
65
|
+
* ActionManageSecurity is the re-authentication action for changing how
|
|
66
|
+
* the account confirms it's you, such as setting a PIN.
|
|
67
|
+
*/
|
|
68
|
+
export const ActionManageSecurity = "manage_security";
|
|
69
|
+
/**
|
|
70
|
+
* StepUpResetTwoFactor is the re-authentication an admin needs to reset
|
|
71
|
+
* another user's two-factor sign-in: whoever can, and knows the password,
|
|
72
|
+
* can take the account over.
|
|
73
|
+
*/
|
|
74
|
+
export const StepUpResetTwoFactor = "reset_user_2fa";
|
|
75
|
+
//////////
|
|
76
|
+
// source: errors.go
|
|
77
|
+
export const ErrCodeUnauthenticated = "reauth.unauthenticated";
|
|
78
|
+
export const ErrCodeInvalidProof = "reauth.invalid_proof";
|
|
79
|
+
export const ErrCodeMethodUnavailable = "reauth.method_unavailable";
|
|
80
|
+
export const ErrCodeLocked = "reauth.locked";
|
|
81
|
+
export const ErrCodePINLocked = "reauth.pin_locked";
|
|
82
|
+
export const ErrCodeInvalidPIN = "reauth.invalid_pin";
|
|
83
|
+
export const ErrCodeNoTOTPSetup = "reauth.no_totp_setup";
|
|
84
|
+
export const ErrCodeNotEnoughMethods = "reauth.not_enough_methods";
|
|
85
|
+
export const ErrCodeSameFactor = "reauth.same_factor";
|
|
86
|
+
export const ErrCodeLastMethod = "reauth.last_method";
|
|
87
|
+
export const ErrCodeBiometricKeyNotFound = "reauth.biometric_key_not_found";
|
|
88
|
+
export const ErrCodeInvalidPublicKey = "reauth.invalid_public_key";
|
|
89
|
+
export const ErrCodeTwoFactorOff = "reauth.two_factor_off";
|
|
90
|
+
//////////
|
|
91
|
+
// source: permissions.go
|
|
92
|
+
/**
|
|
93
|
+
* An admin's actions on another user's second factors (docs/user-admin.md).
|
|
94
|
+
* Keys name the users they act on, though this module guards them.
|
|
95
|
+
*/
|
|
96
|
+
export const PermissionResetTwoFactor = "users.reset_2fa";
|
|
97
|
+
/**
|
|
98
|
+
* An admin's actions on another user's second factors (docs/user-admin.md).
|
|
99
|
+
* Keys name the users they act on, though this module guards them.
|
|
100
|
+
*/
|
|
101
|
+
export const PermissionUnlockPIN = "users.unlock_pin";
|
|
102
|
+
//////////
|
|
103
|
+
// source: ratelimits.go
|
|
104
|
+
/**
|
|
105
|
+
* RateLimitTokens limits creating reauth tokens and sending reauth
|
|
106
|
+
* codes, per signed-in user.
|
|
107
|
+
*/
|
|
108
|
+
export const RateLimitTokens = "reauth.tokens";
|
|
109
|
+
/**
|
|
110
|
+
* RateLimitTwoFactor limits the public two-factor sign-in calls per
|
|
111
|
+
* pending sign-in (mfa_token), on top of each method's own lockout.
|
|
112
|
+
*/
|
|
113
|
+
export const RateLimitTwoFactor = "reauth.two_factor";
|
|
114
|
+
//////////
|
|
115
|
+
// source: settings.go
|
|
116
|
+
export const SettingTokenTTLSeconds = "reauth.token_ttl_seconds";
|
|
117
|
+
export const SettingMaxFailures = "reauth.max_failures";
|
|
118
|
+
export const SettingLockoutSeconds = "reauth.lockout_seconds";
|
|
119
|
+
export const SettingAuthPINLength = "reauth.pin.auth.length";
|
|
120
|
+
export const SettingAuthPINMaxAttempts = "reauth.pin.auth.max_attempts";
|
|
121
|
+
export const SettingTransactionPINLength = "reauth.pin.transaction.length";
|
|
122
|
+
export const SettingTransactionPINMaxAttempts = "reauth.pin.transaction.max_attempts";
|