@hawcx/oauth-client 0.1.0 → 4.0.1
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/README.md +475 -204
- package/dist/delegation/credentials.d.ts +92 -0
- package/dist/delegation/credentials.d.ts.map +1 -0
- package/dist/delegation/credentials.js +215 -0
- package/dist/delegation/credentials.js.map +1 -0
- package/dist/delegation/crypto.d.ts +2 -2
- package/dist/delegation/crypto.d.ts.map +1 -1
- package/dist/delegation/crypto.js +41 -32
- package/dist/delegation/crypto.js.map +1 -1
- package/dist/delegation/exceptions.d.ts +12 -5
- package/dist/delegation/exceptions.d.ts.map +1 -1
- package/dist/delegation/exceptions.js +12 -14
- package/dist/delegation/exceptions.js.map +1 -1
- package/dist/delegation/factory.d.ts +20 -0
- package/dist/delegation/factory.d.ts.map +1 -0
- package/dist/delegation/factory.js +49 -0
- package/dist/delegation/factory.js.map +1 -0
- package/dist/delegation/hawcx.d.ts +67 -224
- package/dist/delegation/hawcx.d.ts.map +1 -1
- package/dist/delegation/hawcx.js +116 -299
- package/dist/delegation/hawcx.js.map +1 -1
- package/dist/delegation/index.d.ts +4 -9
- package/dist/delegation/index.d.ts.map +1 -1
- package/dist/delegation/index.js +5 -17
- package/dist/delegation/index.js.map +1 -1
- package/dist/delegation/transport.d.ts +40 -0
- package/dist/delegation/transport.d.ts.map +1 -0
- package/dist/delegation/transport.js +120 -0
- package/dist/delegation/transport.js.map +1 -0
- package/dist/errors.d.ts +14 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +29 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +10 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -27
- package/dist/index.js.map +1 -1
- package/dist/oauth.d.ts +98 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +150 -0
- package/dist/oauth.js.map +1 -0
- package/dist/stepup/client.d.ts +26 -0
- package/dist/stepup/client.d.ts.map +1 -0
- package/dist/stepup/client.js +84 -0
- package/dist/stepup/client.js.map +1 -0
- package/dist/stepup/index.d.ts +3 -0
- package/dist/stepup/index.d.ts.map +1 -0
- package/dist/stepup/index.js +19 -0
- package/dist/stepup/index.js.map +1 -0
- package/dist/stepup/types.d.ts +36 -0
- package/dist/stepup/types.d.ts.map +1 -0
- package/dist/stepup/types.js +3 -0
- package/dist/stepup/types.js.map +1 -0
- package/package.json +16 -17
- package/LICENSE +0 -22
- package/dist/client.d.ts +0 -134
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -301
- package/dist/client.js.map +0 -1
- package/dist/delegation/client.d.ts +0 -116
- package/dist/delegation/client.d.ts.map +0 -1
- package/dist/delegation/client.js +0 -227
- package/dist/delegation/client.js.map +0 -1
- package/dist/exceptions.d.ts +0 -52
- package/dist/exceptions.d.ts.map +0 -1
- package/dist/exceptions.js +0 -81
- package/dist/exceptions.js.map +0 -1
- package/dist/utils.d.ts +0 -61
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -263
- package/dist/utils.js.map +0 -1
package/dist/delegation/hawcx.js
CHANGED
|
@@ -1,152 +1,132 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Hawcx
|
|
4
|
-
*
|
|
5
|
-
* This module provides a streamlined API for common Hawcx operations like
|
|
6
|
-
* MFA configuration, user management, and device operations. All cryptographic
|
|
7
|
-
* operations (encryption, signing, verification) are handled automatically.
|
|
3
|
+
* Hawcx delegation client with ergonomic, high-level operations.
|
|
8
4
|
*/
|
|
9
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
11
|
-
const
|
|
12
|
-
const crypto_1 = require("./crypto");
|
|
6
|
+
exports.DelegationClient = exports.MfaMethod = void 0;
|
|
7
|
+
const factory_1 = require("./factory");
|
|
13
8
|
const exceptions_1 = require("./exceptions");
|
|
14
|
-
/**
|
|
15
|
-
* Supported MFA methods for Hawcx authentication.
|
|
16
|
-
*
|
|
17
|
-
* This enum ensures type safety and prevents typos when specifying MFA methods.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* import { MfaMethod } from '@hawcx/oauth-client';
|
|
22
|
-
*
|
|
23
|
-
* // Use enum for type safety
|
|
24
|
-
* await client.initiateMfaChange({
|
|
25
|
-
* userid: "user@example.com",
|
|
26
|
-
* mfaMethod: MfaMethod.SMS, // Type-safe!
|
|
27
|
-
* phoneNumber: "+15551234567"
|
|
28
|
-
* });
|
|
29
|
-
*
|
|
30
|
-
* // String values still work for backwards compatibility
|
|
31
|
-
* await client.initiateMfaChange({
|
|
32
|
-
* userid: "user@example.com",
|
|
33
|
-
* mfaMethod: "sms", // Also works
|
|
34
|
-
* phoneNumber: "+15551234567"
|
|
35
|
-
* });
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
9
|
var MfaMethod;
|
|
39
10
|
(function (MfaMethod) {
|
|
40
11
|
MfaMethod["EMAIL"] = "email";
|
|
41
12
|
MfaMethod["SMS"] = "sms";
|
|
42
13
|
MfaMethod["TOTP"] = "totp";
|
|
43
14
|
})(MfaMethod || (exports.MfaMethod = MfaMethod = {}));
|
|
44
|
-
|
|
45
|
-
* High-level client for Hawcx delegation operations.
|
|
46
|
-
*
|
|
47
|
-
* This client provides simplified methods for common Hawcx operations:
|
|
48
|
-
* - MFA configuration (email, SMS, TOTP)
|
|
49
|
-
* - User credential management
|
|
50
|
-
* - Device operations
|
|
51
|
-
*
|
|
52
|
-
* All requests are automatically encrypted (ECIES) and signed (Ed25519/RSA-PSS).
|
|
53
|
-
* All responses are automatically verified and decrypted.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```typescript
|
|
57
|
-
* // Initialize from keys
|
|
58
|
-
* const client = HawcxDelegationClient.fromKeys({
|
|
59
|
-
* spSigningKey: process.env.SP_SIGNING_KEY!,
|
|
60
|
-
* spEncryptionKey: process.env.SP_ENCRYPTION_KEY!,
|
|
61
|
-
* idpVerifyKey: process.env.IDP_VERIFY_KEY!,
|
|
62
|
-
* idpEncryptionKey: process.env.IDP_ENCRYPTION_KEY!,
|
|
63
|
-
* baseUrl: 'https://ceasar-api.hawcx.com',
|
|
64
|
-
* spId: 'my-client-id'
|
|
65
|
-
* });
|
|
66
|
-
*
|
|
67
|
-
* // Initiate SMS MFA setup
|
|
68
|
-
* const result = await client.initiateMfaChange({
|
|
69
|
-
* userid: "user@example.com",
|
|
70
|
-
* mfaMethod: "sms",
|
|
71
|
-
* phoneNumber: "+15551234567"
|
|
72
|
-
* });
|
|
73
|
-
* console.log(result.session_id);
|
|
74
|
-
*
|
|
75
|
-
* // Verify OTP
|
|
76
|
-
* await client.verifyMfaChange({
|
|
77
|
-
* userid: "user@example.com",
|
|
78
|
-
* sessionId: result.session_id,
|
|
79
|
-
* otp: "123456"
|
|
80
|
-
* });
|
|
81
|
-
* ```
|
|
82
|
-
*/
|
|
83
|
-
class HawcxDelegationClient {
|
|
15
|
+
class DelegationClient {
|
|
84
16
|
constructor(options) {
|
|
85
|
-
this.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
17
|
+
this.mfa = {
|
|
18
|
+
initiate: async (options) => {
|
|
19
|
+
const { userId, mfaMethod, phoneNumber, mfaChangeTo } = options;
|
|
20
|
+
const mfaMethodStr = typeof mfaMethod === 'string' ? mfaMethod : String(mfaMethod);
|
|
21
|
+
const mfaChangeToStr = mfaChangeTo ? String(mfaChangeTo) : undefined;
|
|
22
|
+
const validMethods = [MfaMethod.EMAIL, MfaMethod.SMS, MfaMethod.TOTP];
|
|
23
|
+
if (!validMethods.includes(mfaMethodStr)) {
|
|
24
|
+
throw new exceptions_1.DelegationRequestError(`Invalid mfa_method '${mfaMethodStr}'. Must be one of: ${validMethods.join(', ')}`);
|
|
25
|
+
}
|
|
26
|
+
if (mfaMethodStr === MfaMethod.SMS && !phoneNumber) {
|
|
27
|
+
throw new exceptions_1.DelegationRequestError('phoneNumber is required for SMS MFA');
|
|
28
|
+
}
|
|
29
|
+
const payload = {
|
|
30
|
+
userid: userId,
|
|
31
|
+
mfa_method: mfaMethodStr,
|
|
32
|
+
};
|
|
33
|
+
if (mfaMethodStr === MfaMethod.SMS && phoneNumber) {
|
|
34
|
+
payload.contact = phoneNumber;
|
|
35
|
+
}
|
|
36
|
+
if (mfaChangeToStr) {
|
|
37
|
+
payload.mfa_change_to = mfaChangeToStr;
|
|
38
|
+
}
|
|
39
|
+
return await this.request({
|
|
40
|
+
endpoint: '/hc_auth/v5/update/initiate',
|
|
41
|
+
payload,
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
verify: async (options) => {
|
|
45
|
+
const { userId, sessionId, otp } = options;
|
|
46
|
+
if (otp?.length !== 6 || !/^\d{6}$/.test(otp)) {
|
|
47
|
+
throw new exceptions_1.DelegationRequestError('OTP must be a 6-digit code');
|
|
48
|
+
}
|
|
49
|
+
const payload = {
|
|
50
|
+
userid: userId,
|
|
51
|
+
session_id: sessionId,
|
|
52
|
+
otp,
|
|
53
|
+
};
|
|
54
|
+
return await this.request({
|
|
55
|
+
endpoint: '/hc_auth/v5/update/verify',
|
|
56
|
+
payload,
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
this.users = {
|
|
61
|
+
getCredentials: async (userId) => {
|
|
62
|
+
const payload = { userid: userId };
|
|
63
|
+
return await this.request({
|
|
64
|
+
endpoint: '/hc_auth/v5/update/get-creds',
|
|
65
|
+
payload,
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
getPhone: async (userId) => {
|
|
69
|
+
const payload = { userid: userId };
|
|
70
|
+
return await this.request({
|
|
71
|
+
endpoint: '/hc_auth/v5/management/users/phone',
|
|
72
|
+
payload,
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
updatePhone: async (options) => {
|
|
76
|
+
const payload = {
|
|
77
|
+
userid: options.userId,
|
|
78
|
+
new_phone_number: options.newPhoneNumber,
|
|
79
|
+
};
|
|
80
|
+
return await this.request({
|
|
81
|
+
endpoint: '/hc_auth/v5/management/users/phone',
|
|
82
|
+
payload,
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
this.devices = {
|
|
87
|
+
list: async (userId) => {
|
|
88
|
+
const payload = { userid: userId };
|
|
89
|
+
return await this.request({
|
|
90
|
+
endpoint: '/hc_auth/v5/manage/devices',
|
|
91
|
+
payload,
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
revoke: async (options) => {
|
|
95
|
+
const payload = { userid: options.userId, h2index: options.deviceId };
|
|
96
|
+
return await this.request({
|
|
97
|
+
endpoint: '/hc_auth/v5/manage/revoke',
|
|
98
|
+
payload,
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
unrevoke: async (options) => {
|
|
102
|
+
const payload = { userid: options.userId, h2index: options.deviceId };
|
|
103
|
+
return await this.request({
|
|
104
|
+
endpoint: '/hc_auth/v5/manage/unrevoke',
|
|
105
|
+
payload,
|
|
106
|
+
});
|
|
107
|
+
},
|
|
108
|
+
delete: async (options) => {
|
|
109
|
+
const payload = { userid: options.userId, h2index: options.deviceId };
|
|
110
|
+
return await this.request({
|
|
111
|
+
endpoint: '/hc_auth/v5/manage/delete',
|
|
112
|
+
payload,
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
this.transport = options.transport;
|
|
94
117
|
this.apiKey = options.apiKey;
|
|
95
118
|
this.baseUrl = options.baseUrl;
|
|
96
|
-
this.spId = options.spId;
|
|
97
119
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
* as values to the SDK.
|
|
104
|
-
*
|
|
105
|
-
* @param options - Configuration options
|
|
106
|
-
* @returns Configured HawcxDelegationClient instance
|
|
107
|
-
* @throws DelegationRequestError if key initialization fails
|
|
108
|
-
*
|
|
109
|
-
* @example
|
|
110
|
-
* ```typescript
|
|
111
|
-
* import * as process from 'process';
|
|
112
|
-
*
|
|
113
|
-
* // App controls how to load keys
|
|
114
|
-
* const client = HawcxDelegationClient.fromKeys({
|
|
115
|
-
* spSigningKey: process.env.MY_SIGNING_KEY!,
|
|
116
|
-
* spEncryptionKey: process.env.MY_ENCRYPTION_KEY!,
|
|
117
|
-
* idpVerifyKey: process.env.IDP_VERIFY_KEY!,
|
|
118
|
-
* idpEncryptionKey: process.env.IDP_ENCRYPT_KEY!,
|
|
119
|
-
* baseUrl: process.env.HAWCX_URL!,
|
|
120
|
-
* spId: process.env.MY_CLIENT_ID!
|
|
121
|
-
* });
|
|
122
|
-
* ```
|
|
123
|
-
*/
|
|
120
|
+
static fromSecretKey(options) {
|
|
121
|
+
const { apiKey, baseUrl } = options;
|
|
122
|
+
const transport = (0, factory_1.buildTransportFromSecretKey)(options);
|
|
123
|
+
return new DelegationClient({ transport, apiKey, baseUrl });
|
|
124
|
+
}
|
|
124
125
|
static fromKeys(options) {
|
|
125
|
-
const {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const verifier = new crypto_1.Verifier({ [idpKid]: idpVerifyKey });
|
|
129
|
-
const encryptor = new crypto_1.EciesX25519Encryptor(idpEncryptionKey);
|
|
130
|
-
const decryptor = new crypto_1.EciesX25519Decryptor(spEncryptionKey);
|
|
131
|
-
console.log(`Initialized HawcxDelegationClient with base_url=${baseUrl}, sp_id=${spId}`);
|
|
132
|
-
return new HawcxDelegationClient({
|
|
133
|
-
baseUrl,
|
|
134
|
-
signer,
|
|
135
|
-
verifier,
|
|
136
|
-
encryptor,
|
|
137
|
-
decryptor,
|
|
138
|
-
spId,
|
|
139
|
-
apiKey,
|
|
140
|
-
timeout,
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
catch (error) {
|
|
144
|
-
throw new exceptions_1.DelegationRequestError(`Failed to initialize crypto helpers: ${error}`);
|
|
145
|
-
}
|
|
126
|
+
const { apiKey, baseUrl } = options;
|
|
127
|
+
const transport = (0, factory_1.buildTransportFromKeys)(options);
|
|
128
|
+
return new DelegationClient({ transport, apiKey, baseUrl });
|
|
146
129
|
}
|
|
147
|
-
/**
|
|
148
|
-
* Build Hawcx API authentication headers
|
|
149
|
-
*/
|
|
150
130
|
buildAuthHeaders() {
|
|
151
131
|
const headers = {};
|
|
152
132
|
if (this.apiKey) {
|
|
@@ -154,173 +134,10 @@ class HawcxDelegationClient {
|
|
|
154
134
|
}
|
|
155
135
|
return headers;
|
|
156
136
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
* This method starts the MFA enrollment/update process by sending an OTP
|
|
161
|
-
* to the user via their chosen method (email, SMS, or generating a TOTP secret).
|
|
162
|
-
*
|
|
163
|
-
* @param options - MFA initiation configuration
|
|
164
|
-
* @returns Dictionary containing session_id and optional TOTP details
|
|
165
|
-
* @throws DelegationRequestError if request fails or parameters are invalid
|
|
166
|
-
* @throws Error if SMS method specified without phone_number
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* ```typescript
|
|
170
|
-
* import { MfaMethod } from '@hawcx/oauth-client';
|
|
171
|
-
*
|
|
172
|
-
* // Email MFA (with enum - recommended!)
|
|
173
|
-
* const result = await client.initiateMfaChange({
|
|
174
|
-
* userid: "user@example.com",
|
|
175
|
-
* mfaMethod: MfaMethod.EMAIL
|
|
176
|
-
* });
|
|
177
|
-
*
|
|
178
|
-
* // SMS MFA (string also works)
|
|
179
|
-
* const result = await client.initiateMfaChange({
|
|
180
|
-
* userid: "user@example.com",
|
|
181
|
-
* mfaMethod: "sms",
|
|
182
|
-
* phoneNumber: "+15551234567"
|
|
183
|
-
* });
|
|
184
|
-
*
|
|
185
|
-
* // TOTP MFA
|
|
186
|
-
* const result = await client.initiateMfaChange({
|
|
187
|
-
* userid: "user@example.com",
|
|
188
|
-
* mfaMethod: MfaMethod.TOTP
|
|
189
|
-
* });
|
|
190
|
-
* console.log(`Scan QR code: ${result.otpauth_uri}`);
|
|
191
|
-
* ```
|
|
192
|
-
*/
|
|
193
|
-
async initiateMfaChange(options) {
|
|
194
|
-
const { userid, mfaMethod, phoneNumber, mfaChangeTo } = options;
|
|
195
|
-
// Convert enum to string if needed
|
|
196
|
-
const mfaMethodStr = typeof mfaMethod === 'string' ? mfaMethod : String(mfaMethod);
|
|
197
|
-
const mfaChangeToStr = mfaChangeTo
|
|
198
|
-
? typeof mfaChangeTo === 'string'
|
|
199
|
-
? mfaChangeTo
|
|
200
|
-
: String(mfaChangeTo)
|
|
201
|
-
: undefined;
|
|
202
|
-
// Validate method
|
|
203
|
-
const validMethods = [MfaMethod.EMAIL, MfaMethod.SMS, MfaMethod.TOTP];
|
|
204
|
-
if (!validMethods.includes(mfaMethodStr)) {
|
|
205
|
-
throw new Error(`Invalid mfa_method '${mfaMethodStr}'. Must be one of: ${validMethods.join(', ')}`);
|
|
206
|
-
}
|
|
207
|
-
// Validate SMS requires phone number
|
|
208
|
-
if (mfaMethodStr === MfaMethod.SMS && !phoneNumber) {
|
|
209
|
-
throw new Error('phone_number is required for SMS MFA');
|
|
210
|
-
}
|
|
211
|
-
// Build Hawcx UpdateTable API payload
|
|
212
|
-
const payload = {
|
|
213
|
-
userid,
|
|
214
|
-
mfa_method: mfaMethodStr,
|
|
215
|
-
};
|
|
216
|
-
// Add SMS phone number
|
|
217
|
-
if (mfaMethodStr === MfaMethod.SMS && phoneNumber) {
|
|
218
|
-
payload.contact = phoneNumber;
|
|
219
|
-
}
|
|
220
|
-
// Add target method if changing
|
|
221
|
-
if (mfaChangeToStr) {
|
|
222
|
-
payload.mfa_change_to = mfaChangeToStr;
|
|
223
|
-
}
|
|
224
|
-
console.log(`[MFA Initiate] Method=${mfaMethodStr} for user=${userid}`);
|
|
225
|
-
try {
|
|
226
|
-
const response = await this.client.sendSecureRequest({
|
|
227
|
-
endpoint: '/hc_auth/v5/update/initiate',
|
|
228
|
-
payload,
|
|
229
|
-
extraHeaders: this.buildAuthHeaders(),
|
|
230
|
-
});
|
|
231
|
-
console.log(`[MFA Initiate] Success for user=${userid}, session_id=${response.session_id}`);
|
|
232
|
-
return response;
|
|
233
|
-
}
|
|
234
|
-
catch (error) {
|
|
235
|
-
console.error(`[MFA Initiate] Failed for user=${userid}:`, error);
|
|
236
|
-
throw error;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Verify OTP and complete MFA configuration change.
|
|
241
|
-
*
|
|
242
|
-
* This method verifies the OTP sent to the user and completes the MFA
|
|
243
|
-
* enrollment/update process.
|
|
244
|
-
*
|
|
245
|
-
* @param options - MFA verification configuration
|
|
246
|
-
* @returns Dictionary containing success message and optional mfa_changed_to
|
|
247
|
-
* @throws DelegationRequestError if verification fails
|
|
248
|
-
* @throws Error if OTP format is invalid
|
|
249
|
-
*
|
|
250
|
-
* @example
|
|
251
|
-
* ```typescript
|
|
252
|
-
* // Get OTP from user
|
|
253
|
-
* const otp = getUserInput();
|
|
254
|
-
*
|
|
255
|
-
* // Verify and complete MFA setup
|
|
256
|
-
* const result = await client.verifyMfaChange({
|
|
257
|
-
* userid: "user@example.com",
|
|
258
|
-
* sessionId: sessionId,
|
|
259
|
-
* otp: otp
|
|
260
|
-
* });
|
|
261
|
-
* console.log(`MFA updated: ${result.detail}`);
|
|
262
|
-
* ```
|
|
263
|
-
*/
|
|
264
|
-
async verifyMfaChange(options) {
|
|
265
|
-
const { userid, sessionId, otp } = options;
|
|
266
|
-
// Validate OTP format
|
|
267
|
-
if (!otp || otp.length !== 6 || !/^\d{6}$/.test(otp)) {
|
|
268
|
-
throw new Error('OTP must be a 6-digit code');
|
|
269
|
-
}
|
|
270
|
-
// Build Hawcx UpdateTable API payload
|
|
271
|
-
const payload = {
|
|
272
|
-
userid,
|
|
273
|
-
session_id: sessionId,
|
|
274
|
-
otp,
|
|
275
|
-
};
|
|
276
|
-
console.log(`[MFA Verify] Verifying OTP for user=${userid}, session=${sessionId}`);
|
|
277
|
-
try {
|
|
278
|
-
const response = await this.client.sendSecureRequest({
|
|
279
|
-
endpoint: '/hc_auth/v5/update/verify',
|
|
280
|
-
payload,
|
|
281
|
-
extraHeaders: this.buildAuthHeaders(),
|
|
282
|
-
});
|
|
283
|
-
console.log(`[MFA Verify] Success for user=${userid}`);
|
|
284
|
-
return response;
|
|
285
|
-
}
|
|
286
|
-
catch (error) {
|
|
287
|
-
console.error(`[MFA Verify] Failed for user=${userid}:`, error);
|
|
288
|
-
throw error;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Get user's stored credentials and MFA status.
|
|
293
|
-
*
|
|
294
|
-
* This method retrieves the user's credentials from Hawcx, including
|
|
295
|
-
* their current MFA configuration.
|
|
296
|
-
*
|
|
297
|
-
* @param userid - User identifier
|
|
298
|
-
* @returns Dictionary containing user credentials and MFA status
|
|
299
|
-
*
|
|
300
|
-
* @example
|
|
301
|
-
* ```typescript
|
|
302
|
-
* const creds = await client.getUserCredentials("user@example.com");
|
|
303
|
-
* console.log(`MFA method: ${creds.mfa_method}`);
|
|
304
|
-
* console.log(`Phone: ${creds.contact}`);
|
|
305
|
-
* ```
|
|
306
|
-
*/
|
|
307
|
-
async getUserCredentials(userid) {
|
|
308
|
-
const payload = { userid };
|
|
309
|
-
console.log(`[Get Creds] Fetching credentials for user=${userid}`);
|
|
310
|
-
try {
|
|
311
|
-
const response = await this.client.sendSecureRequest({
|
|
312
|
-
endpoint: '/hc_auth/v5/update/get-creds',
|
|
313
|
-
payload,
|
|
314
|
-
extraHeaders: this.buildAuthHeaders(),
|
|
315
|
-
});
|
|
316
|
-
console.log(`[Get Creds] Success for user=${userid}`);
|
|
317
|
-
return response;
|
|
318
|
-
}
|
|
319
|
-
catch (error) {
|
|
320
|
-
console.error(`[Get Creds] Failed for user=${userid}:`, error);
|
|
321
|
-
throw error;
|
|
322
|
-
}
|
|
137
|
+
async request(options) {
|
|
138
|
+
const headers = { ...this.buildAuthHeaders(), ...(options.headers ?? {}) };
|
|
139
|
+
return await this.transport.send({ ...options, headers });
|
|
323
140
|
}
|
|
324
141
|
}
|
|
325
|
-
exports.
|
|
142
|
+
exports.DelegationClient = DelegationClient;
|
|
326
143
|
//# sourceMappingURL=hawcx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hawcx.js","sourceRoot":"","sources":["../../src/delegation/hawcx.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"hawcx.js","sourceRoot":"","sources":["../../src/delegation/hawcx.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,uCAAuG;AACvG,6CAAsD;AAEtD,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB;AAmED,MAAa,gBAAgB;IAM3B,YAAY,OAA6E;QAiCzE,QAAG,GAAG;YACpB,QAAQ,EAAE,KAAK,EAAE,OAA2B,EAAuB,EAAE;gBACnE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;gBAEhE,MAAM,YAAY,GAAG,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBACnF,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBAErE,MAAM,YAAY,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;gBACtE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,YAAyB,CAAC,EAAE,CAAC;oBACtD,MAAM,IAAI,mCAAsB,CAC9B,uBAAuB,YAAY,sBAAsB,YAAY,CAAC,IAAI,CAAC,IAAI,CAA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AC3C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAClC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,OAAO,CACX,OAAuC;QAEvC,MAAM,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,gBAAgB,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC;QAC3E,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAa,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;CAmHF;AAxJD,4CAwJC"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hawcx OAuth Client SDK - Delegation Module
|
|
3
|
-
*
|
|
4
|
-
* Exposes the client and utilities for making secure, backend-to-backend
|
|
5
|
-
* delegated requests to an IDP.
|
|
6
|
-
*
|
|
7
|
-
* For Hawcx-specific operations, use HawcxDelegationClient for simplified high-level API.
|
|
8
|
-
* For generic delegation operations, use IdpDelegationClient for lower-level control.
|
|
9
3
|
*/
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
4
|
+
export { DelegationClient, MfaMethod, } from './hawcx';
|
|
5
|
+
export type { DelegationClientBaseOptions, DelegationClientSecretKeyOptions, DelegationClientKeyOptions, MfaInitiateOptions, MfaVerifyOptions, UpdatePhoneOptions, DeviceOperationOptions, DelegationRequestOptions, } from './hawcx';
|
|
6
|
+
export { parseHawcxSecretKey, generateCredentialBlob, } from './credentials';
|
|
7
|
+
export type { ParsedCredentials, HawcxCredentialBlob, } from './credentials';
|
|
13
8
|
export { DelegationError, DelegationCryptoError, DelegationRequestError, DelegationResponseError, } from './exceptions';
|
|
14
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/delegation/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/delegation/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,gBAAgB,EAChB,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,cAAc,CAAC"}
|
package/dist/delegation/index.js
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* Hawcx OAuth Client SDK - Delegation Module
|
|
4
|
-
*
|
|
5
|
-
* Exposes the client and utilities for making secure, backend-to-backend
|
|
6
|
-
* delegated requests to an IDP.
|
|
7
|
-
*
|
|
8
|
-
* For Hawcx-specific operations, use HawcxDelegationClient for simplified high-level API.
|
|
9
|
-
* For generic delegation operations, use IdpDelegationClient for lower-level control.
|
|
10
4
|
*/
|
|
11
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.DelegationResponseError = exports.DelegationRequestError = exports.DelegationCryptoError = exports.DelegationError = exports.
|
|
13
|
-
var client_1 = require("./client");
|
|
14
|
-
Object.defineProperty(exports, "IdpDelegationClient", { enumerable: true, get: function () { return client_1.IdpDelegationClient; } });
|
|
6
|
+
exports.DelegationResponseError = exports.DelegationRequestError = exports.DelegationCryptoError = exports.DelegationError = exports.generateCredentialBlob = exports.parseHawcxSecretKey = exports.MfaMethod = exports.DelegationClient = void 0;
|
|
15
7
|
var hawcx_1 = require("./hawcx");
|
|
16
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "DelegationClient", { enumerable: true, get: function () { return hawcx_1.DelegationClient; } });
|
|
17
9
|
Object.defineProperty(exports, "MfaMethod", { enumerable: true, get: function () { return hawcx_1.MfaMethod; } });
|
|
18
|
-
var
|
|
19
|
-
Object.defineProperty(exports, "
|
|
20
|
-
Object.defineProperty(exports, "
|
|
21
|
-
Object.defineProperty(exports, "Verifier", { enumerable: true, get: function () { return crypto_1.Verifier; } });
|
|
22
|
-
Object.defineProperty(exports, "EciesX25519Encryptor", { enumerable: true, get: function () { return crypto_1.EciesX25519Encryptor; } });
|
|
23
|
-
Object.defineProperty(exports, "EciesX25519Decryptor", { enumerable: true, get: function () { return crypto_1.EciesX25519Decryptor; } });
|
|
24
|
-
Object.defineProperty(exports, "nowS", { enumerable: true, get: function () { return crypto_1.nowS; } });
|
|
10
|
+
var credentials_1 = require("./credentials");
|
|
11
|
+
Object.defineProperty(exports, "parseHawcxSecretKey", { enumerable: true, get: function () { return credentials_1.parseHawcxSecretKey; } });
|
|
12
|
+
Object.defineProperty(exports, "generateCredentialBlob", { enumerable: true, get: function () { return credentials_1.generateCredentialBlob; } });
|
|
25
13
|
var exceptions_1 = require("./exceptions");
|
|
26
14
|
Object.defineProperty(exports, "DelegationError", { enumerable: true, get: function () { return exceptions_1.DelegationError; } });
|
|
27
15
|
Object.defineProperty(exports, "DelegationCryptoError", { enumerable: true, get: function () { return exceptions_1.DelegationCryptoError; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/delegation/index.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/delegation/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iCAGiB;AAFf,yGAAA,gBAAgB,OAAA;AAChB,kGAAA,SAAS,OAAA;AAaX,6CAGuB;AAFrB,kHAAA,mBAAmB,OAAA;AACnB,qHAAA,sBAAsB,OAAA;AAOxB,2CAKsB;AAJpB,6GAAA,eAAe,OAAA;AACf,mHAAA,qBAAqB,OAAA;AACrB,oHAAA,sBAAsB,OAAA;AACtB,qHAAA,uBAAuB,OAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secure transport for ECIES-encrypted and signed delegation requests.
|
|
3
|
+
*/
|
|
4
|
+
import { Verifier, EciesX25519Encryptor, EciesX25519Decryptor, Ed25519Signer, RsaPssSigner } from './crypto';
|
|
5
|
+
export type Signer = Ed25519Signer | RsaPssSigner;
|
|
6
|
+
export type JsonObject = Record<string, unknown> | object;
|
|
7
|
+
export interface SecureRequestOptions<TPayload extends JsonObject> {
|
|
8
|
+
/** API endpoint path (e.g., "/mfa/update" or "/device/revoke") */
|
|
9
|
+
endpoint: string;
|
|
10
|
+
/** Request payload dictionary to be encrypted and sent */
|
|
11
|
+
payload: TPayload;
|
|
12
|
+
/** If true, prepends base_url to endpoint (default: true) */
|
|
13
|
+
includeBaseUrl?: boolean;
|
|
14
|
+
/** Optional additional HTTP headers (e.g., API keys) */
|
|
15
|
+
headers?: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
export interface DelegationTransportOptions {
|
|
18
|
+
baseUrl: string;
|
|
19
|
+
signer: Signer;
|
|
20
|
+
verifier: Verifier;
|
|
21
|
+
encryptor: EciesX25519Encryptor;
|
|
22
|
+
decryptor: EciesX25519Decryptor;
|
|
23
|
+
timeoutSeconds?: number;
|
|
24
|
+
clockSkewSeconds?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare class DelegationTransport {
|
|
27
|
+
private baseUrl;
|
|
28
|
+
private signer;
|
|
29
|
+
private verifier;
|
|
30
|
+
private encryptor;
|
|
31
|
+
private decryptor;
|
|
32
|
+
private timeoutSeconds;
|
|
33
|
+
private clockSkewSeconds;
|
|
34
|
+
constructor(options: DelegationTransportOptions);
|
|
35
|
+
/**
|
|
36
|
+
* Send an encrypted and signed delegation request to the IDP.
|
|
37
|
+
*/
|
|
38
|
+
send<TReq extends JsonObject, TRes extends JsonObject>(options: SecureRequestOptions<TReq>): Promise<TRes>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/delegation/transport.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,QAAQ,EACR,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACb,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,MAAM,GAAG,aAAa,GAAG,YAAY,CAAC;AAClD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;AAE1D,MAAM,WAAW,oBAAoB,CAAC,QAAQ,SAAS,UAAU;IAC/D,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,OAAO,EAAE,QAAQ,CAAC;IAClB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,oBAAoB,CAAC;IAChC,SAAS,EAAE,oBAAoB,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC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