@typekcz-nocobase-plugins/plugin-oidc-plus 1.0.2 → 1.0.4

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.
Files changed (75) hide show
  1. package/dist/client/index.js +1 -3
  2. package/dist/externalVersion.js +9 -9
  3. package/package.json +10 -10
  4. package/src/client/OIDCButton.tsx +70 -0
  5. package/src/client/Options.tsx +359 -0
  6. package/src/client/index.tsx +19 -0
  7. package/src/client/locale/index.ts +18 -0
  8. package/src/constants.ts +7 -0
  9. package/src/index.ts +2 -0
  10. package/src/locale/en-US.json +40 -0
  11. package/src/locale/es-ES.json +25 -0
  12. package/src/locale/fr-FR.json +21 -0
  13. package/src/locale/ko_KR.json +28 -0
  14. package/src/locale/pt-BR.json +21 -0
  15. package/src/locale/zh-CN.json +28 -0
  16. package/src/server/__tests__/oidc.test.ts +283 -0
  17. package/src/server/actions/getAuthUrl.ts +25 -0
  18. package/src/server/actions/redirect.ts +32 -0
  19. package/src/server/index.ts +1 -0
  20. package/src/server/oidc-auth.ts +169 -0
  21. package/src/server/plugin.ts +63 -0
  22. package/src/swagger/index.ts +157 -0
  23. package/dist/node_modules/nanoid/LICENSE +0 -20
  24. package/dist/node_modules/nanoid/async/index.browser.cjs +0 -34
  25. package/dist/node_modules/nanoid/async/index.browser.js +0 -34
  26. package/dist/node_modules/nanoid/async/index.cjs +0 -35
  27. package/dist/node_modules/nanoid/async/index.d.ts +0 -56
  28. package/dist/node_modules/nanoid/async/index.js +0 -35
  29. package/dist/node_modules/nanoid/async/index.native.js +0 -26
  30. package/dist/node_modules/nanoid/async/package.json +0 -12
  31. package/dist/node_modules/nanoid/bin/nanoid.cjs +0 -55
  32. package/dist/node_modules/nanoid/index.browser.cjs +0 -34
  33. package/dist/node_modules/nanoid/index.browser.js +0 -34
  34. package/dist/node_modules/nanoid/index.cjs +0 -1
  35. package/dist/node_modules/nanoid/index.d.ts +0 -91
  36. package/dist/node_modules/nanoid/index.js +0 -45
  37. package/dist/node_modules/nanoid/nanoid.js +0 -1
  38. package/dist/node_modules/nanoid/non-secure/index.cjs +0 -21
  39. package/dist/node_modules/nanoid/non-secure/index.d.ts +0 -33
  40. package/dist/node_modules/nanoid/non-secure/index.js +0 -21
  41. package/dist/node_modules/nanoid/non-secure/package.json +0 -6
  42. package/dist/node_modules/nanoid/package.json +0 -1
  43. package/dist/node_modules/nanoid/url-alphabet/index.cjs +0 -3
  44. package/dist/node_modules/nanoid/url-alphabet/index.js +0 -3
  45. package/dist/node_modules/nanoid/url-alphabet/package.json +0 -6
  46. package/dist/node_modules/openid-client/lib/client.js +0 -1849
  47. package/dist/node_modules/openid-client/lib/device_flow_handle.js +0 -125
  48. package/dist/node_modules/openid-client/lib/errors.js +0 -55
  49. package/dist/node_modules/openid-client/lib/helpers/assert.js +0 -24
  50. package/dist/node_modules/openid-client/lib/helpers/base64url.js +0 -13
  51. package/dist/node_modules/openid-client/lib/helpers/client.js +0 -211
  52. package/dist/node_modules/openid-client/lib/helpers/consts.js +0 -7
  53. package/dist/node_modules/openid-client/lib/helpers/decode_jwt.js +0 -27
  54. package/dist/node_modules/openid-client/lib/helpers/deep_clone.js +0 -1
  55. package/dist/node_modules/openid-client/lib/helpers/defaults.js +0 -27
  56. package/dist/node_modules/openid-client/lib/helpers/generators.js +0 -14
  57. package/dist/node_modules/openid-client/lib/helpers/is_key_object.js +0 -4
  58. package/dist/node_modules/openid-client/lib/helpers/is_plain_object.js +0 -1
  59. package/dist/node_modules/openid-client/lib/helpers/issuer.js +0 -111
  60. package/dist/node_modules/openid-client/lib/helpers/keystore.js +0 -298
  61. package/dist/node_modules/openid-client/lib/helpers/merge.js +0 -24
  62. package/dist/node_modules/openid-client/lib/helpers/pick.js +0 -9
  63. package/dist/node_modules/openid-client/lib/helpers/process_response.js +0 -71
  64. package/dist/node_modules/openid-client/lib/helpers/request.js +0 -200
  65. package/dist/node_modules/openid-client/lib/helpers/unix_timestamp.js +0 -1
  66. package/dist/node_modules/openid-client/lib/helpers/weak_cache.js +0 -1
  67. package/dist/node_modules/openid-client/lib/helpers/webfinger_normalize.js +0 -71
  68. package/dist/node_modules/openid-client/lib/helpers/www_authenticate_parser.js +0 -14
  69. package/dist/node_modules/openid-client/lib/index.js +0 -1
  70. package/dist/node_modules/openid-client/lib/issuer.js +0 -191
  71. package/dist/node_modules/openid-client/lib/issuer_registry.js +0 -3
  72. package/dist/node_modules/openid-client/lib/passport_strategy.js +0 -205
  73. package/dist/node_modules/openid-client/lib/token_set.js +0 -35
  74. package/dist/node_modules/openid-client/package.json +0 -1
  75. package/dist/node_modules/openid-client/types/index.d.ts +0 -622
@@ -1,91 +0,0 @@
1
- /**
2
- * Generate secure URL-friendly unique ID.
3
- *
4
- * By default, the ID will have 21 symbols to have a collision probability
5
- * similar to UUID v4.
6
- *
7
- * ```js
8
- * import { nanoid } from 'nanoid'
9
- * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"
10
- * ```
11
- *
12
- * @param size Size of the ID. The default size is 21.
13
- * @returns A random string.
14
- */
15
- export function nanoid(size?: number): string
16
-
17
- /**
18
- * Generate secure unique ID with custom alphabet.
19
- *
20
- * Alphabet must contain 256 symbols or less. Otherwise, the generator
21
- * will not be secure.
22
- *
23
- * @param alphabet Alphabet used to generate the ID.
24
- * @param defaultSize Size of the ID. The default size is 21.
25
- * @returns A random string generator.
26
- *
27
- * ```js
28
- * const { customAlphabet } = require('nanoid')
29
- * const nanoid = customAlphabet('0123456789абвгдеё', 5)
30
- * nanoid() //=> "8ё56а"
31
- * ```
32
- */
33
- export function customAlphabet(
34
- alphabet: string,
35
- defaultSize?: number
36
- ): (size?: number) => string
37
-
38
- /**
39
- * Generate unique ID with custom random generator and alphabet.
40
- *
41
- * Alphabet must contain 256 symbols or less. Otherwise, the generator
42
- * will not be secure.
43
- *
44
- * ```js
45
- * import { customRandom } from 'nanoid/format'
46
- *
47
- * const nanoid = customRandom('abcdef', 5, size => {
48
- * const random = []
49
- * for (let i = 0; i < size; i++) {
50
- * random.push(randomByte())
51
- * }
52
- * return random
53
- * })
54
- *
55
- * nanoid() //=> "fbaef"
56
- * ```
57
- *
58
- * @param alphabet Alphabet used to generate a random string.
59
- * @param size Size of the random string.
60
- * @param random A random bytes generator.
61
- * @returns A random string generator.
62
- */
63
- export function customRandom(
64
- alphabet: string,
65
- size: number,
66
- random: (bytes: number) => Uint8Array
67
- ): () => string
68
-
69
- /**
70
- * URL safe symbols.
71
- *
72
- * ```js
73
- * import { urlAlphabet } from 'nanoid'
74
- * const nanoid = customAlphabet(urlAlphabet, 10)
75
- * nanoid() //=> "Uakgb_J5m9"
76
- * ```
77
- */
78
- export const urlAlphabet: string
79
-
80
- /**
81
- * Generate an array of random bytes collected from hardware noise.
82
- *
83
- * ```js
84
- * import { customRandom, random } from 'nanoid'
85
- * const nanoid = customRandom("abcdef", 5, random)
86
- * ```
87
- *
88
- * @param bytes Size of the array.
89
- * @returns An array of random bytes.
90
- */
91
- export function random(bytes: number): Uint8Array
@@ -1,45 +0,0 @@
1
- import crypto from 'crypto'
2
- import { urlAlphabet } from './url-alphabet/index.js'
3
- const POOL_SIZE_MULTIPLIER = 128
4
- let pool, poolOffset
5
- let fillPool = bytes => {
6
- if (!pool || pool.length < bytes) {
7
- pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)
8
- crypto.randomFillSync(pool)
9
- poolOffset = 0
10
- } else if (poolOffset + bytes > pool.length) {
11
- crypto.randomFillSync(pool)
12
- poolOffset = 0
13
- }
14
- poolOffset += bytes
15
- }
16
- let random = bytes => {
17
- fillPool((bytes -= 0))
18
- return pool.subarray(poolOffset - bytes, poolOffset)
19
- }
20
- let customRandom = (alphabet, defaultSize, getRandom) => {
21
- let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1
22
- let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)
23
- return (size = defaultSize) => {
24
- let id = ''
25
- while (true) {
26
- let bytes = getRandom(step)
27
- let i = step
28
- while (i--) {
29
- id += alphabet[bytes[i] & mask] || ''
30
- if (id.length === size) return id
31
- }
32
- }
33
- }
34
- }
35
- let customAlphabet = (alphabet, size = 21) =>
36
- customRandom(alphabet, size, random)
37
- let nanoid = (size = 21) => {
38
- fillPool((size -= 0))
39
- let id = ''
40
- for (let i = poolOffset - size; i < poolOffset; i++) {
41
- id += urlAlphabet[pool[i] & 63]
42
- }
43
- return id
44
- }
45
- export { nanoid, customAlphabet, customRandom, urlAlphabet, random }
@@ -1 +0,0 @@
1
- export let nanoid=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e<63?"_":"-"),"");
@@ -1,21 +0,0 @@
1
- let urlAlphabet =
2
- 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
3
- let customAlphabet = (alphabet, defaultSize = 21) => {
4
- return (size = defaultSize) => {
5
- let id = ''
6
- let i = size
7
- while (i--) {
8
- id += alphabet[(Math.random() * alphabet.length) | 0]
9
- }
10
- return id
11
- }
12
- }
13
- let nanoid = (size = 21) => {
14
- let id = ''
15
- let i = size
16
- while (i--) {
17
- id += urlAlphabet[(Math.random() * 64) | 0]
18
- }
19
- return id
20
- }
21
- module.exports = { nanoid, customAlphabet }
@@ -1,33 +0,0 @@
1
- /**
2
- * Generate URL-friendly unique ID. This method uses the non-secure
3
- * predictable random generator with bigger collision probability.
4
- *
5
- * ```js
6
- * import { nanoid } from 'nanoid/non-secure'
7
- * model.id = nanoid() //=> "Uakgb_J5m9g-0JDMbcJqL"
8
- * ```
9
- *
10
- * @param size Size of the ID. The default size is 21.
11
- * @returns A random string.
12
- */
13
- export function nanoid(size?: number): string
14
-
15
- /**
16
- * Generate a unique ID based on a custom alphabet.
17
- * This method uses the non-secure predictable random generator
18
- * with bigger collision probability.
19
- *
20
- * @param alphabet Alphabet used to generate the ID.
21
- * @param defaultSize Size of the ID. The default size is 21.
22
- * @returns A random string generator.
23
- *
24
- * ```js
25
- * import { customAlphabet } from 'nanoid/non-secure'
26
- * const nanoid = customAlphabet('0123456789абвгдеё', 5)
27
- * model.id = //=> "8ё56а"
28
- * ```
29
- */
30
- export function customAlphabet(
31
- alphabet: string,
32
- defaultSize?: number
33
- ): (size?: number) => string
@@ -1,21 +0,0 @@
1
- let urlAlphabet =
2
- 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
3
- let customAlphabet = (alphabet, defaultSize = 21) => {
4
- return (size = defaultSize) => {
5
- let id = ''
6
- let i = size
7
- while (i--) {
8
- id += alphabet[(Math.random() * alphabet.length) | 0]
9
- }
10
- return id
11
- }
12
- }
13
- let nanoid = (size = 21) => {
14
- let id = ''
15
- let i = size
16
- while (i--) {
17
- id += urlAlphabet[(Math.random() * 64) | 0]
18
- }
19
- return id
20
- }
21
- export { nanoid, customAlphabet }
@@ -1,6 +0,0 @@
1
- {
2
- "type": "module",
3
- "main": "index.cjs",
4
- "module": "index.js",
5
- "react-native": "index.js"
6
- }
@@ -1 +0,0 @@
1
- {"name":"nanoid","version":"3.3.4","description":"A tiny (116 bytes), secure URL-friendly unique string ID generator","keywords":["uuid","random","id","url"],"engines":{"node":"^10 || ^12 || ^13.7 || ^14 || >=15.0.1"},"author":"Andrey Sitnik <andrey@sitnik.ru>","license":"MIT","repository":"ai/nanoid","browser":{"./index.js":"./index.browser.js","./async/index.js":"./async/index.browser.js","./async/index.cjs":"./async/index.browser.cjs","./index.cjs":"./index.browser.cjs"},"react-native":"index.js","bin":"./bin/nanoid.cjs","sideEffects":false,"types":"./index.d.ts","type":"module","main":"index.cjs","module":"index.js","exports":{".":{"types":"./index.d.ts","browser":"./index.browser.js","require":"./index.cjs","import":"./index.js","default":"./index.js"},"./index.d.ts":"./index.d.ts","./package.json":"./package.json","./async/package.json":"./async/package.json","./async":{"browser":"./async/index.browser.js","require":"./async/index.cjs","import":"./async/index.js","default":"./async/index.js"},"./non-secure/package.json":"./non-secure/package.json","./non-secure":{"require":"./non-secure/index.cjs","import":"./non-secure/index.js","default":"./non-secure/index.js"},"./url-alphabet/package.json":"./url-alphabet/package.json","./url-alphabet":{"require":"./url-alphabet/index.cjs","import":"./url-alphabet/index.js","default":"./url-alphabet/index.js"}},"_lastModified":"2024-03-26T12:28:54.494Z"}
@@ -1,3 +0,0 @@
1
- let urlAlphabet =
2
- 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
3
- module.exports = { urlAlphabet }
@@ -1,3 +0,0 @@
1
- let urlAlphabet =
2
- 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
3
- export { urlAlphabet }
@@ -1,6 +0,0 @@
1
- {
2
- "type": "module",
3
- "main": "index.cjs",
4
- "module": "index.js",
5
- "react-native": "index.js"
6
- }