@authup/server-core 0.29.0
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 +21 -0
- package/README.md +23 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/read.d.ts +3 -0
- package/dist/config/read.d.ts.map +1 -0
- package/dist/config/type.d.ts +5 -0
- package/dist/config/type.d.ts.map +1 -0
- package/dist/config/utils.d.ts +2 -0
- package/dist/config/utils.d.ts.map +1 -0
- package/dist/crypto/hash/compare.d.ts +2 -0
- package/dist/crypto/hash/compare.d.ts.map +1 -0
- package/dist/crypto/hash/hash.d.ts +2 -0
- package/dist/crypto/hash/hash.d.ts.map +1 -0
- package/dist/crypto/hash/index.d.ts +3 -0
- package/dist/crypto/hash/index.d.ts.map +1 -0
- package/dist/crypto/index.d.ts +4 -0
- package/dist/crypto/index.d.ts.map +1 -0
- package/dist/crypto/json-web-token/decode.d.ts +15 -0
- package/dist/crypto/json-web-token/decode.d.ts.map +1 -0
- package/dist/crypto/json-web-token/index.d.ts +5 -0
- package/dist/crypto/json-web-token/index.d.ts.map +1 -0
- package/dist/crypto/json-web-token/sign.d.ts +4 -0
- package/dist/crypto/json-web-token/sign.d.ts.map +1 -0
- package/dist/crypto/json-web-token/type.d.ts +32 -0
- package/dist/crypto/json-web-token/type.d.ts.map +1 -0
- package/dist/crypto/json-web-token/utils.d.ts +2 -0
- package/dist/crypto/json-web-token/utils.d.ts.map +1 -0
- package/dist/crypto/json-web-token/verify.d.ts +15 -0
- package/dist/crypto/json-web-token/verify.d.ts.map +1 -0
- package/dist/crypto/key-pair/constants.d.ts +5 -0
- package/dist/crypto/key-pair/constants.d.ts.map +1 -0
- package/dist/crypto/key-pair/create.d.ts +3 -0
- package/dist/crypto/key-pair/create.d.ts.map +1 -0
- package/dist/crypto/key-pair/delete.d.ts +3 -0
- package/dist/crypto/key-pair/delete.d.ts.map +1 -0
- package/dist/crypto/key-pair/index.d.ts +9 -0
- package/dist/crypto/key-pair/index.d.ts.map +1 -0
- package/dist/crypto/key-pair/load.d.ts +3 -0
- package/dist/crypto/key-pair/load.d.ts.map +1 -0
- package/dist/crypto/key-pair/module.d.ts +3 -0
- package/dist/crypto/key-pair/module.d.ts.map +1 -0
- package/dist/crypto/key-pair/save.d.ts +3 -0
- package/dist/crypto/key-pair/save.d.ts.map +1 -0
- package/dist/crypto/key-pair/type.d.ts +65 -0
- package/dist/crypto/key-pair/type.d.ts.map +1 -0
- package/dist/crypto/key-pair/utils/check.d.ts +3 -0
- package/dist/crypto/key-pair/utils/check.d.ts.map +1 -0
- package/dist/crypto/key-pair/utils/file-name.d.ts +4 -0
- package/dist/crypto/key-pair/utils/file-name.d.ts.map +1 -0
- package/dist/crypto/key-pair/utils/index.d.ts +5 -0
- package/dist/crypto/key-pair/utils/index.d.ts.map +1 -0
- package/dist/crypto/key-pair/utils/options.d.ts +3 -0
- package/dist/crypto/key-pair/utils/options.d.ts.map +1 -0
- package/dist/crypto/key-pair/utils/private-key.d.ts +4 -0
- package/dist/crypto/key-pair/utils/private-key.d.ts.map +1 -0
- package/dist/domain-event/index.d.ts +5 -0
- package/dist/domain-event/index.d.ts.map +1 -0
- package/dist/domain-event/publish.d.ts +4 -0
- package/dist/domain-event/publish.d.ts.map +1 -0
- package/dist/domain-event/redis/index.d.ts +2 -0
- package/dist/domain-event/redis/index.d.ts.map +1 -0
- package/dist/domain-event/redis/publish.d.ts +4 -0
- package/dist/domain-event/redis/publish.d.ts.map +1 -0
- package/dist/domain-event/socket/index.d.ts +3 -0
- package/dist/domain-event/socket/index.d.ts.map +1 -0
- package/dist/domain-event/socket/publish.d.ts +4 -0
- package/dist/domain-event/socket/publish.d.ts.map +1 -0
- package/dist/domain-event/socket/singleton.d.ts +4 -0
- package/dist/domain-event/socket/singleton.d.ts.map +1 -0
- package/dist/domain-event/socket/type.d.ts +5 -0
- package/dist/domain-event/socket/type.d.ts.map +1 -0
- package/dist/domain-event/type.d.ts +7 -0
- package/dist/domain-event/type.d.ts.map +1 -0
- package/dist/domain-event/utils.d.ts +4 -0
- package/dist/domain-event/utils.d.ts.map +1 -0
- package/dist/domains/index.d.ts +2 -0
- package/dist/domains/index.d.ts.map +1 -0
- package/dist/domains/robot/index.d.ts +2 -0
- package/dist/domains/robot/index.d.ts.map +1 -0
- package/dist/domains/robot/vault.d.ts +5 -0
- package/dist/domains/robot/vault.d.ts.map +1 -0
- package/dist/index.cjs +873 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +831 -0
- package/dist/index.mjs.map +1 -0
- package/dist/logger/index.d.ts +4 -0
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/module.d.ts +4 -0
- package/dist/logger/module.d.ts.map +1 -0
- package/dist/logger/presets/index.d.ts +2 -0
- package/dist/logger/presets/index.d.ts.map +1 -0
- package/dist/logger/presets/void.d.ts +16 -0
- package/dist/logger/presets/void.d.ts.map +1 -0
- package/dist/logger/type.d.ts +14 -0
- package/dist/logger/type.d.ts.map +1 -0
- package/dist/proxy/index.d.ts +3 -0
- package/dist/proxy/index.d.ts.map +1 -0
- package/dist/proxy/module.d.ts +24 -0
- package/dist/proxy/module.d.ts.map +1 -0
- package/dist/proxy/utils.d.ts +3 -0
- package/dist/proxy/utils.d.ts.map +1 -0
- package/dist/smtp/config/index.d.ts +2 -0
- package/dist/smtp/config/index.d.ts.map +1 -0
- package/dist/smtp/config/singleton.d.ts +5 -0
- package/dist/smtp/config/singleton.d.ts.map +1 -0
- package/dist/smtp/index.d.ts +5 -0
- package/dist/smtp/index.d.ts.map +1 -0
- package/dist/smtp/module.d.ts +4 -0
- package/dist/smtp/module.d.ts.map +1 -0
- package/dist/smtp/singleton.d.ts +3 -0
- package/dist/smtp/singleton.d.ts.map +1 -0
- package/dist/smtp/type.d.ts +14 -0
- package/dist/smtp/type.d.ts.map +1 -0
- package/dist/utils/env.d.ts +7 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/has-property.d.ts +2 -0
- package/dist/utils/has-property.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/vault/index.d.ts +2 -0
- package/dist/vault/index.d.ts.map +1 -0
- package/dist/vault/module.d.ts +4 -0
- package/dist/vault/module.d.ts.map +1 -0
- package/package.json +79 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Peter Placzek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @authup/server-core 🛠
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/@authup%2Fserver-core)
|
|
4
|
+
[](https://github.com/authup/authup/actions/workflows/main.yml)
|
|
5
|
+
[](https://codecov.io/gh/authup/authup)
|
|
6
|
+
[](https://snyk.io/test/github/authup/authup)
|
|
7
|
+
|
|
8
|
+
The main propose of this package, is to provide general utilities for authorization & authentication.
|
|
9
|
+
|
|
10
|
+
**Table of Contents**
|
|
11
|
+
|
|
12
|
+
- [Documentation](#documentation)
|
|
13
|
+
- [License](#license)
|
|
14
|
+
|
|
15
|
+
## Documentation
|
|
16
|
+
|
|
17
|
+
To read the docs, visit [https://authup.org/](https://authup.org/)
|
|
18
|
+
|
|
19
|
+
## License
|
|
20
|
+
|
|
21
|
+
Made with 💚
|
|
22
|
+
|
|
23
|
+
Published under [MIT License](./LICENSE).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAOA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/config/read.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAGpD,wBAAsB,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CA6DnG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/config/type.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,qBAAqB,GAAG;IAChC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/config/utils.ts"],"names":[],"mappings":"AAWA,wBAAgB,uCAAuC,aAiBtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../../src/crypto/hash/compare.ts"],"names":[],"mappings":"AASA,wBAAsB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAI,OAAO,CAAC,OAAO,CAAC,CAEnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../src/crypto/hash/hash.ts"],"names":[],"mappings":"AASA,wBAAsB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,GAAE,MAAM,GAAG,MAAW,GAAI,OAAO,CAAC,MAAM,CAAC,CAE5F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crypto/hash/index.ts"],"names":[],"mappings":"AAOA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/crypto/index.ts"],"names":[],"mappings":"AAOA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Jwt, JwtPayload } from 'jsonwebtoken';
|
|
2
|
+
import type { TokenDecodeOptions } from './type';
|
|
3
|
+
/**
|
|
4
|
+
* Decode a JWT token with no verification.
|
|
5
|
+
*
|
|
6
|
+
* @param token
|
|
7
|
+
* @param options
|
|
8
|
+
*
|
|
9
|
+
* @throws TokenError
|
|
10
|
+
*/
|
|
11
|
+
export declare function decodeToken(token: string, options: TokenDecodeOptions & {
|
|
12
|
+
complete: true;
|
|
13
|
+
}): null | Jwt;
|
|
14
|
+
export declare function decodeToken(token: string, options?: TokenDecodeOptions): JwtPayload | string | null;
|
|
15
|
+
//# sourceMappingURL=decode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../src/crypto/json-web-token/decode.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACR,GAAG,EACH,UAAU,EACb,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAGjD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,GAAG,IAAI,GAAG,GAAG,CAAC;AACzG,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crypto/json-web-token/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../../src/crypto/json-web-token/sign.ts"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE/C,wBAAsB,SAAS,CAC3B,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACvD,OAAO,EAAE,gBAAgB,GAC1B,OAAO,CAAC,MAAM,CAAC,CA4BjB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { DecodeOptions, SignOptions, VerifyOptions } from 'jsonwebtoken';
|
|
3
|
+
import type { KeyType } from '@authup/core';
|
|
4
|
+
import type { KeyPair, KeyPairOptions } from '../key-pair';
|
|
5
|
+
export type TokenSignOptions = ({
|
|
6
|
+
type: `${KeyType.RSA}` | KeyType.RSA;
|
|
7
|
+
algorithm?: 'RS256' | 'RS384' | 'RS512' | 'PS256' | 'PS384' | 'PS512';
|
|
8
|
+
keyPair: KeyPair | Partial<KeyPairOptions> | string;
|
|
9
|
+
} | {
|
|
10
|
+
type: `${KeyType.EC}` | KeyType.EC;
|
|
11
|
+
algorithm?: 'ES256' | 'ES384' | 'ES512';
|
|
12
|
+
keyPair: KeyPair | Partial<KeyPairOptions> | string;
|
|
13
|
+
} | {
|
|
14
|
+
type: `${KeyType.OCT}` | KeyType.OCT;
|
|
15
|
+
algorithm?: 'HS256' | 'HS384' | 'HS512';
|
|
16
|
+
secret: string | Buffer;
|
|
17
|
+
}) & Omit<SignOptions, 'algorithm'>;
|
|
18
|
+
export type TokenVerifyOptions = ({
|
|
19
|
+
type: `${KeyType.RSA}` | KeyType.RSA;
|
|
20
|
+
algorithms?: ('RS256' | 'RS384' | 'RS512' | 'PS256' | 'PS384' | 'PS512')[];
|
|
21
|
+
keyPair: KeyPair | Partial<KeyPairOptions> | string;
|
|
22
|
+
} | {
|
|
23
|
+
type: `${KeyType.EC}` | KeyType.EC;
|
|
24
|
+
algorithms?: ('ES256' | 'ES384' | 'ES512')[];
|
|
25
|
+
keyPair: KeyPair | Partial<KeyPairOptions> | string;
|
|
26
|
+
} | {
|
|
27
|
+
type: `${KeyType.OCT}` | KeyType.OCT;
|
|
28
|
+
algorithms?: ('HS256' | 'HS384' | 'HS512')[];
|
|
29
|
+
secret: string | Buffer;
|
|
30
|
+
}) & Omit<VerifyOptions, 'algorithms'>;
|
|
31
|
+
export type TokenDecodeOptions = DecodeOptions;
|
|
32
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/crypto/json-web-token/type.ts"],"names":[],"mappings":";AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG,CAAC;IAC5B,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IACrC,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,GACvC,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IAC5B,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,MAAM,CAAA;CACtD,GAAG;IACA,IAAI,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IACxC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,MAAM,CAAA;CACtD,GAAG;IACA,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IACrC,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;IACxC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CAC1B,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAEpC,MAAM,MAAM,kBAAkB,GAAG,CAAC;IAC9B,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IACrC,UAAU,CAAC,EAAE,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,GACzC,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC;IAC/B,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,MAAM,CAAA;CACtD,GAAG;IACA,IAAI,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;IACnC,UAAU,CAAC,EAAE,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC;IAC7C,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,MAAM,CAAA;CACtD,GAAG;IACA,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IACrC,UAAU,CAAC,EAAE,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC;IAC7C,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CAC1B,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;AAEvC,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/crypto/json-web-token/utils.ts"],"names":[],"mappings":"AASA,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,QAmCxC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Jwt, JwtPayload } from 'jsonwebtoken';
|
|
2
|
+
import type { TokenVerifyOptions } from './type';
|
|
3
|
+
/**
|
|
4
|
+
* Verify JWT.
|
|
5
|
+
*
|
|
6
|
+
* @param token
|
|
7
|
+
* @param context
|
|
8
|
+
*
|
|
9
|
+
* @throws TokenError
|
|
10
|
+
*/
|
|
11
|
+
export declare function verifyToken(token: string, context: TokenVerifyOptions & {
|
|
12
|
+
complete: true;
|
|
13
|
+
}): Promise<string | Jwt>;
|
|
14
|
+
export declare function verifyToken(token: string, context: TokenVerifyOptions): Promise<JwtPayload | string>;
|
|
15
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/crypto/json-web-token/verify.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAIpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAGjD;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;AAC1H,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/crypto/key-pair/constants.ts"],"names":[],"mappings":"AAOA,oBAAY,WAAW;IACnB,OAAO,YAAY;IACnB,MAAM,WAAW;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/crypto/key-pair/create.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAItD,wBAAsB,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAI,OAAO,CAAC,OAAO,CAAC,CA2DxF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/crypto/key-pair/delete.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAI7C,wBAAsB,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAI,OAAO,CAAC,IAAI,CAAC,CAiBrF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crypto/key-pair/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/crypto/key-pair/load.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAKtD,wBAAsB,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAI,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CA4DlG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/crypto/key-pair/module.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAOtD,wBAAsB,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,MAAM,GAAI,OAAO,CAAC,OAAO,CAAC,CAuB5F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save.d.ts","sourceRoot":"","sources":["../../../src/crypto/key-pair/save.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAItD,wBAAsB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,cAAc,GAAI,OAAO,CAAC,OAAO,CAAC,CAoB/F"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { DSAKeyPairOptions, ECKeyPairOptions, RSAKeyPairOptions, RSAPSSKeyPairOptions } from 'node:crypto';
|
|
3
|
+
export type KeyPair = {
|
|
4
|
+
privateKey: string;
|
|
5
|
+
publicKey: string;
|
|
6
|
+
};
|
|
7
|
+
export type RSAKeyPairGenerator = {
|
|
8
|
+
type: 'rsa';
|
|
9
|
+
} & RSAKeyPairOptions<'pem', 'pem'>;
|
|
10
|
+
export type RSAPSSKeyPairGenerator = {
|
|
11
|
+
type: 'rsa-pss';
|
|
12
|
+
} & RSAPSSKeyPairOptions<'pem', 'pem'>;
|
|
13
|
+
export type DSAKeyPairGenerator = {
|
|
14
|
+
type: 'dsa';
|
|
15
|
+
} & DSAKeyPairOptions<'pem', 'pem'>;
|
|
16
|
+
export type ECKeyPairGenerator = {
|
|
17
|
+
type: 'ec';
|
|
18
|
+
} & ECKeyPairOptions<'pem', 'pem'>;
|
|
19
|
+
export type KeyPairGenerator = DSAKeyPairGenerator | RSAKeyPairGenerator | RSAPSSKeyPairGenerator | ECKeyPairGenerator;
|
|
20
|
+
export type KeyPairBaseOptions = {
|
|
21
|
+
/**
|
|
22
|
+
* Directory where to save key-pair.
|
|
23
|
+
*
|
|
24
|
+
* default: process.cwd()
|
|
25
|
+
*/
|
|
26
|
+
directory: string;
|
|
27
|
+
/**
|
|
28
|
+
* Private key name
|
|
29
|
+
*
|
|
30
|
+
* default: private
|
|
31
|
+
*/
|
|
32
|
+
privateName: string;
|
|
33
|
+
/**
|
|
34
|
+
* Extension for private key.
|
|
35
|
+
*
|
|
36
|
+
* default: pem
|
|
37
|
+
*/
|
|
38
|
+
privateExtension: string;
|
|
39
|
+
/**
|
|
40
|
+
* Public key name
|
|
41
|
+
*
|
|
42
|
+
* default: public
|
|
43
|
+
*/
|
|
44
|
+
publicName: string;
|
|
45
|
+
/**
|
|
46
|
+
* Extension for public key.
|
|
47
|
+
*
|
|
48
|
+
* default: pem
|
|
49
|
+
*/
|
|
50
|
+
publicExtension: string;
|
|
51
|
+
/**
|
|
52
|
+
* Passphrase for private key.
|
|
53
|
+
*
|
|
54
|
+
* default: undefined
|
|
55
|
+
*/
|
|
56
|
+
passphrase: string;
|
|
57
|
+
/**
|
|
58
|
+
* Save key-pair to file system.
|
|
59
|
+
*
|
|
60
|
+
* default: false
|
|
61
|
+
*/
|
|
62
|
+
save: boolean;
|
|
63
|
+
};
|
|
64
|
+
export type KeyPairOptions = KeyPairBaseOptions & KeyPairGenerator;
|
|
65
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/crypto/key-pair/type.ts"],"names":[],"mappings":";AAOA,OAAO,KAAK,EACR,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACvB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,OAAO,GAAG;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,EAAE,KAAK,CAAA;CACd,GAAG,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEpC,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,SAAS,CAAC;CACnB,GAAG,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEvC,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,EAAE,KAAK,CAAA;CACd,GAAG,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEpC,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,IAAI,CAAC;CACd,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEnC,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAClD,mBAAmB,GACnB,sBAAsB,GACtB,kBAAkB,CAAC;AAEnB,MAAM,MAAM,kBAAkB,GAAG;IAC7B;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,EAAE,OAAO,CAAA;CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../../src/crypto/key-pair/utils/check.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAI,IAAI,IAAI,OAAO,CAKzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-name.d.ts","sourceRoot":"","sources":["../../../../src/crypto/key-pair/utils/file-name.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,wBAAgB,gBAAgB,CAC5B,IAAI,EAAE,GAAG,WAAW,EAAE,EACtB,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,UA8CpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/crypto/key-pair/utils/index.ts"],"names":[],"mappings":"AAOA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/crypto/key-pair/utils/options.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,oBAAoB,CAChC,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GACjC,cAAc,CAwCjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"private-key.d.ts","sourceRoot":"","sources":["../../../../src/crypto/key-pair/utils/private-key.ts"],"names":[],"mappings":";AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,oBAAoB,CAChC,OAAO,EAAE,cAAc,EACvB,GAAG,EAAE,MAAM,GAAG,MAAM,GACpB,MAAM,CAkBT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domain-event/index.ts"],"names":[],"mappings":"AAOA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DomainEventContext } from '@authup/core';
|
|
2
|
+
import type { DomainEventDestinations } from './type';
|
|
3
|
+
export declare function publishDomainEvent(context: DomainEventContext, destinations: DomainEventDestinations): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/domain-event/publish.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AAEtD,wBAAsB,kBAAkB,CACpC,OAAO,EAAE,kBAAkB,EAC3B,YAAY,EAAE,uBAAuB,iBAIxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain-event/redis/index.ts"],"names":[],"mappings":"AAOA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DomainEventContext } from '@authup/core';
|
|
2
|
+
import type { DomainEventDestinations } from '../type';
|
|
3
|
+
export declare function publishDomainRedisEvent(context: DomainEventContext, destinations: DomainEventDestinations): Promise<any>;
|
|
4
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../src/domain-event/redis/publish.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAGvD,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,kBAAkB,EAC3B,YAAY,EAAE,uBAAuB,GACrC,OAAO,CAAC,GAAG,CAAC,CA4Bf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain-event/socket/index.ts"],"names":[],"mappings":"AAOA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DomainEventContext } from '@authup/core';
|
|
2
|
+
import type { DomainEventDestinations } from '../type';
|
|
3
|
+
export declare function publishDomainSocketEvent(context: DomainEventContext, destinations: DomainEventDestinations): void;
|
|
4
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../src/domain-event/socket/publish.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAIvD,wBAAgB,wBAAwB,CACpC,OAAO,EAAE,kBAAkB,EAC3B,YAAY,EAAE,uBAAuB,QA2CxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../../src/domain-event/socket/singleton.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,QAAQ,CAAC;AAIzD,wBAAgB,gBAAgB,IAAK,OAAO,CAAC,0BAA0B,CAAC,CAQvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/domain-event/socket/type.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEhG,MAAM,MAAM,0BAA0B,GAAG;KACpC,CAAC,IAAI,mBAAmB,GAAG,CAAC,IAAI,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,KAAK,IAAI;CACrF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type DomainEventChannelName = string | ((id?: string | number) => string);
|
|
2
|
+
export type DomainEventDestination = {
|
|
3
|
+
namespace?: string;
|
|
4
|
+
channel: DomainEventChannelName;
|
|
5
|
+
};
|
|
6
|
+
export type DomainEventDestinations = DomainEventDestination[];
|
|
7
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/domain-event/type.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,CAAC,CAAC;AACjF,MAAM,MAAM,sBAAsB,GAAG;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,sBAAsB,CAAA;CAClC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DomainEventChannelName } from './type';
|
|
2
|
+
export declare function transformDomainEventData<T>(input: T): T;
|
|
3
|
+
export declare function buildDomainEventChannelName(input: DomainEventChannelName, id?: string | number): string;
|
|
4
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/domain-event/utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAErD,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAI,CAAC,CAYxD;AAED,wBAAgB,2BAA2B,CACvC,KAAK,EAAE,sBAAsB,EAC7B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GACpB,MAAM,CAMT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domains/index.ts"],"names":[],"mappings":"AAOA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domains/robot/index.ts"],"names":[],"mappings":"AAOA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Robot } from '@authup/core';
|
|
2
|
+
export declare function saveRobotCredentialsToVault(entity: Pick<Robot, 'id' | 'secret' | 'name'>): Promise<void>;
|
|
3
|
+
export declare function removeRobotCredentialsFromVault(entity: Pick<Robot, 'name'>): Promise<void>;
|
|
4
|
+
export declare function findRobotCredentialsInVault(entity: Pick<Robot, 'name'>): Promise<Pick<Robot, 'id' | 'secret'> | undefined>;
|
|
5
|
+
//# sourceMappingURL=vault.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vault.d.ts","sourceRoot":"","sources":["../../../src/domains/robot/vault.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG1C,wBAAsB,2BAA2B,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC,iBAW9F;AAED,wBAAsB,+BAA+B,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,iBAQhF;AAED,wBAAsB,2BAA2B,CAC7C,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,GAC3B,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,GAAG,QAAQ,CAAC,GAAG,SAAS,CAAC,CAapD"}
|