@crossauth/backend 0.0.2
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 +203 -0
- package/README.md +14 -0
- package/dist/apikey.d.ts +100 -0
- package/dist/apikey.d.ts.map +1 -0
- package/dist/auth.d.ts +131 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/authenticators/dummyfactor2.d.ts +129 -0
- package/dist/authenticators/dummyfactor2.d.ts.map +1 -0
- package/dist/authenticators/emailauth.d.ts +176 -0
- package/dist/authenticators/emailauth.d.ts.map +1 -0
- package/dist/authenticators/ldapauth.d.ts +89 -0
- package/dist/authenticators/ldapauth.d.ts.map +1 -0
- package/dist/authenticators/passwordauth.d.ts +159 -0
- package/dist/authenticators/passwordauth.d.ts.map +1 -0
- package/dist/authenticators/smsauth.d.ts +160 -0
- package/dist/authenticators/smsauth.d.ts.map +1 -0
- package/dist/authenticators/tests/ldapauth.test.d.ts +2 -0
- package/dist/authenticators/tests/ldapauth.test.d.ts.map +1 -0
- package/dist/authenticators/totpauth.d.ts +117 -0
- package/dist/authenticators/totpauth.d.ts.map +1 -0
- package/dist/authenticators/twilioauth.d.ts +29 -0
- package/dist/authenticators/twilioauth.d.ts.map +1 -0
- package/dist/cookieauth.d.ts +269 -0
- package/dist/cookieauth.d.ts.map +1 -0
- package/dist/crypto.d.ts +196 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/emailtokens.d.ts +178 -0
- package/dist/emailtokens.d.ts.map +1 -0
- package/dist/index.cjs +9107 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9090 -0
- package/dist/oauth/authserver.d.ts +490 -0
- package/dist/oauth/authserver.d.ts.map +1 -0
- package/dist/oauth/client.d.ts +72 -0
- package/dist/oauth/client.d.ts.map +1 -0
- package/dist/oauth/clientmanager.d.ts +73 -0
- package/dist/oauth/clientmanager.d.ts.map +1 -0
- package/dist/oauth/resserver.d.ts +43 -0
- package/dist/oauth/resserver.d.ts.map +1 -0
- package/dist/oauth/tests/common.d.ts +58 -0
- package/dist/oauth/tests/common.d.ts.map +1 -0
- package/dist/oauth/tests/oauthauthserver_authzcode.test.d.ts +2 -0
- package/dist/oauth/tests/oauthauthserver_authzcode.test.d.ts.map +1 -0
- package/dist/oauth/tests/oauthauthserver_clientcred.test.d.ts +2 -0
- package/dist/oauth/tests/oauthauthserver_clientcred.test.d.ts.map +1 -0
- package/dist/oauth/tests/oauthauthserver_device.test.d.ts +2 -0
- package/dist/oauth/tests/oauthauthserver_device.test.d.ts.map +1 -0
- package/dist/oauth/tests/oauthauthserver_mfa.test.d.ts +5 -0
- package/dist/oauth/tests/oauthauthserver_mfa.test.d.ts.map +1 -0
- package/dist/oauth/tests/oauthauthserver_password.test.d.ts +2 -0
- package/dist/oauth/tests/oauthauthserver_password.test.d.ts.map +1 -0
- package/dist/oauth/tests/oauthclient.test.d.ts +2 -0
- package/dist/oauth/tests/oauthclient.test.d.ts.map +1 -0
- package/dist/oauth/tests/oauthresserver.test.d.ts +2 -0
- package/dist/oauth/tests/oauthresserver.test.d.ts.map +1 -0
- package/dist/oauth/tokenconsumer.d.ts +80 -0
- package/dist/oauth/tokenconsumer.d.ts.map +1 -0
- package/dist/session.d.ts +491 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/storage/dbconnection.d.ts +19 -0
- package/dist/storage/dbconnection.d.ts.map +1 -0
- package/dist/storage/dbstorage.d.ts +319 -0
- package/dist/storage/dbstorage.d.ts.map +1 -0
- package/dist/storage/inmemorystorage.d.ts +225 -0
- package/dist/storage/inmemorystorage.d.ts.map +1 -0
- package/dist/storage/ldapstorage.d.ts +143 -0
- package/dist/storage/ldapstorage.d.ts.map +1 -0
- package/dist/storage/postgresconnection.d.ts +27 -0
- package/dist/storage/postgresconnection.d.ts.map +1 -0
- package/dist/storage/postgresstorage.d.ts +83 -0
- package/dist/storage/postgresstorage.d.ts.map +1 -0
- package/dist/storage/prismastorage.d.ts +361 -0
- package/dist/storage/prismastorage.d.ts.map +1 -0
- package/dist/storage/sqliteconnection.d.ts +35 -0
- package/dist/storage/sqliteconnection.d.ts.map +1 -0
- package/dist/storage/sqlitestorage.d.ts +83 -0
- package/dist/storage/sqlitestorage.d.ts.map +1 -0
- package/dist/storage/tests/dbtests.d.ts +5 -0
- package/dist/storage/tests/dbtests.d.ts.map +1 -0
- package/dist/storage/tests/inmemorystorage.test.d.ts +5 -0
- package/dist/storage/tests/inmemorystorage.test.d.ts.map +1 -0
- package/dist/storage/tests/inmemorytestdata.d.ts +4 -0
- package/dist/storage/tests/inmemorytestdata.d.ts.map +1 -0
- package/dist/storage/tests/ldapstorage.test.d.ts +2 -0
- package/dist/storage/tests/ldapstorage.test.d.ts.map +1 -0
- package/dist/storage/tests/postgresstorage.test.d.ts +2 -0
- package/dist/storage/tests/postgresstorage.test.d.ts.map +1 -0
- package/dist/storage/tests/prismastorage.test.d.ts +4 -0
- package/dist/storage/tests/prismastorage.test.d.ts.map +1 -0
- package/dist/storage/tests/sqlitestorage.test.d.ts +2 -0
- package/dist/storage/tests/sqlitestorage.test.d.ts.map +1 -0
- package/dist/storage.d.ts +411 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/tests/cookieauth.test.d.ts +4 -0
- package/dist/tests/cookieauth.test.d.ts.map +1 -0
- package/dist/tests/crypto.test.d.ts +2 -0
- package/dist/tests/crypto.test.d.ts.map +1 -0
- package/dist/tests/email.test.d.ts +4 -0
- package/dist/tests/email.test.d.ts.map +1 -0
- package/dist/tests/password.test.d.ts +5 -0
- package/dist/tests/password.test.d.ts.map +1 -0
- package/dist/tests/tmp.test.d.ts +2 -0
- package/dist/tests/tmp.test.d.ts.map +1 -0
- package/dist/tests/utils.test.d.ts +2 -0
- package/dist/tests/utils.test.d.ts.map +1 -0
- package/dist/utils.d.ts +41 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../src/tests/utils.test.ts"],"names":[],"mappings":""}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type of parameter that can be parsed from an option value or
|
|
3
|
+
* environment variable
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ParamType {
|
|
6
|
+
String = 0,
|
|
7
|
+
Number = 1,
|
|
8
|
+
Boolean = 2,
|
|
9
|
+
Json = 3,
|
|
10
|
+
JsonArray = 4
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Sets an instance variable in the passed object from the passed options
|
|
14
|
+
* object and environment variable.
|
|
15
|
+
*
|
|
16
|
+
* If the named parameter exists in the options object, that the instance
|
|
17
|
+
* variable is set to that value. Otherwise if the named environment
|
|
18
|
+
* variable exists, it is set from that. Otherwise, the instance variable
|
|
19
|
+
* is not updarted.
|
|
20
|
+
*
|
|
21
|
+
* @param param the name of the parameter in the options variable and the
|
|
22
|
+
* name of the variable in the instance
|
|
23
|
+
* @param type The type of variable. If the value is `StringArray` or `Json`,
|
|
24
|
+
* both the option and the environment variable value should be a
|
|
25
|
+
* string, which will be parsed.
|
|
26
|
+
* @param instance options present in the `options` or environment variables
|
|
27
|
+
* will be set oin a corresponding instance variable in this
|
|
28
|
+
* class or object.
|
|
29
|
+
* @param options object containing options as key/value pairs
|
|
30
|
+
* @param envName name of environment variable
|
|
31
|
+
* @param required if true, an exception will be thrown if the variable is
|
|
32
|
+
* not present in `options` or the environment variable
|
|
33
|
+
* @throws {@link @crossauth/common!CrossauthError} with
|
|
34
|
+
* {@link @crossauth/common!ErrorCode} `Configuration` if `required`
|
|
35
|
+
* is set but the option was not present, or if there was a parsing
|
|
36
|
+
* error.
|
|
37
|
+
*/
|
|
38
|
+
export declare function setParameter(param: string, type: ParamType, instance: any, options: {
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}, envName?: string, required?: boolean): void;
|
|
41
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,oBAAY,SAAS;IACjB,MAAM,IAAI;IACV,MAAM,IAAA;IACN,OAAO,IAAA;IACP,IAAI,IAAA;IACJ,SAAS,IAAA;CACZ;AAkDD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAG,MAAM,EACd,IAAI,EAAG,SAAS,EAChB,QAAQ,EAAG,GAAG,EACd,OAAO,EAAG;IAAC,CAAC,GAAG,EAAC,MAAM,GAAG,GAAG,CAAA;CAAC,EAC7B,OAAO,CAAC,EAAG,MAAM,EAAE,QAAQ,GAAG,OAAa,GAAI,IAAI,CAU/E"}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@crossauth/backend",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.2",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"typings": "./dist/index.d.ts",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/*"
|
|
12
|
+
],
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@types/node": "^20.10.8",
|
|
15
|
+
"jimp": "^0.22.10",
|
|
16
|
+
"jsqr": "^1.4.0",
|
|
17
|
+
"prisma": "^5.12.0",
|
|
18
|
+
"typedoc": "^0.25.4",
|
|
19
|
+
"typescript": "^5.3.3",
|
|
20
|
+
"vite": "^5.0.8",
|
|
21
|
+
"vite-plugin-dts": "^3.6.4",
|
|
22
|
+
"vitest": "^1.1.0",
|
|
23
|
+
"vitest-fetch-mock": "^0.2.2"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
|
27
|
+
"@prisma/client": "^5.12.0",
|
|
28
|
+
"@types/cookie": "^0.6.0",
|
|
29
|
+
"@types/cookie-parser": "^1.4.6",
|
|
30
|
+
"@types/express": "^4.17.21",
|
|
31
|
+
"@types/jsonwebtoken": "^9.0.5",
|
|
32
|
+
"@types/ldapjs": "^3.0.6",
|
|
33
|
+
"@types/nodemailer": "^6.4.14",
|
|
34
|
+
"@types/nunjucks": "^3.2.6",
|
|
35
|
+
"@types/pg": "^8.11.8",
|
|
36
|
+
"@types/qrcode": "^1.5.5",
|
|
37
|
+
"@types/twilio": "^3.19.3",
|
|
38
|
+
"cookie": "^0.6.0",
|
|
39
|
+
"cookie-parser": "^1.4.6",
|
|
40
|
+
"dotenv": "^16.3.1",
|
|
41
|
+
"dotenv-cli": "^7.3.0",
|
|
42
|
+
"events": "^3.3.0",
|
|
43
|
+
"http-request-mock": "^1.8.18",
|
|
44
|
+
"install": "^0.13.0",
|
|
45
|
+
"jose": "^5.2.3",
|
|
46
|
+
"jsonwebtoken": "^9.0.2",
|
|
47
|
+
"jwt-decode": "^4.0.0",
|
|
48
|
+
"ldap-async": "^2.1.1",
|
|
49
|
+
"ldapjs": "^3.0.7",
|
|
50
|
+
"nodemailer": "^6.9.8",
|
|
51
|
+
"nunjucks": "^3.2.4",
|
|
52
|
+
"otplib": "^12.0.1",
|
|
53
|
+
"pg": "^8.12.0",
|
|
54
|
+
"qrcode": "^1.5.3",
|
|
55
|
+
"sonic-boom": "^3.7.0",
|
|
56
|
+
"sqlite3": "^5.1.7",
|
|
57
|
+
"twilio": "^5.0.3",
|
|
58
|
+
"@crossauth/common": "^0.0.2"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"dev": "vite",
|
|
62
|
+
"build": "vite build",
|
|
63
|
+
"preview": "vite preview",
|
|
64
|
+
"test": "dotenv -e .env.unittest vitest",
|
|
65
|
+
"testonce": "dotenv -e .env.unittest vitest run",
|
|
66
|
+
"doc": "typedoc",
|
|
67
|
+
"preinstall": "bash ../../removeprismaclient.sh",
|
|
68
|
+
"postinstall": "bash ../../copyprismaclient.sh && bash ../../ifdotenv.sh -e .env.unittest prisma generate",
|
|
69
|
+
"prisma": "dotenv -e .env.unittest pnpm exec prisma"
|
|
70
|
+
}
|
|
71
|
+
}
|