@tanakayuto/intmax402-core 0.2.2 → 0.2.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/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/www-authenticate.d.ts +2 -0
- package/dist/www-authenticate.js +15 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.parseAuthorization = exports.parseWWWAuthenticate = exports.verifyNonce = exports.generateNonce = void 0;
|
|
17
|
+
exports.buildWWWAuthenticate = exports.parseAuthorization = exports.parseWWWAuthenticate = exports.verifyNonce = exports.generateNonce = void 0;
|
|
18
18
|
__exportStar(require("./types"), exports);
|
|
19
19
|
var nonce_1 = require("./nonce");
|
|
20
20
|
Object.defineProperty(exports, "generateNonce", { enumerable: true, get: function () { return nonce_1.generateNonce; } });
|
|
@@ -23,3 +23,5 @@ Object.defineProperty(exports, "verifyNonce", { enumerable: true, get: function
|
|
|
23
23
|
var parse_1 = require("./parse");
|
|
24
24
|
Object.defineProperty(exports, "parseWWWAuthenticate", { enumerable: true, get: function () { return parse_1.parseWWWAuthenticate; } });
|
|
25
25
|
Object.defineProperty(exports, "parseAuthorization", { enumerable: true, get: function () { return parse_1.parseAuthorization; } });
|
|
26
|
+
var www_authenticate_1 = require("./www-authenticate");
|
|
27
|
+
Object.defineProperty(exports, "buildWWWAuthenticate", { enumerable: true, get: function () { return www_authenticate_1.buildWWWAuthenticate; } });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildWWWAuthenticate = buildWWWAuthenticate;
|
|
4
|
+
function buildWWWAuthenticate(nonce, config) {
|
|
5
|
+
let header = `INTMAX402 realm="intmax402", nonce="${nonce}", mode="${config.mode}"`;
|
|
6
|
+
if (config.serverAddress)
|
|
7
|
+
header += `, serverAddress="${config.serverAddress}"`;
|
|
8
|
+
if (config.amount)
|
|
9
|
+
header += `, amount="${config.amount}"`;
|
|
10
|
+
if (config.tokenAddress)
|
|
11
|
+
header += `, tokenAddress="${config.tokenAddress}"`;
|
|
12
|
+
if (config.chainId)
|
|
13
|
+
header += `, chainId="${config.chainId}"`;
|
|
14
|
+
return header;
|
|
15
|
+
}
|