-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from atls/feat/kratos-admin-sdk
feat/kratos-admin-sdk
- Loading branch information
Showing
188 changed files
with
5,043 additions
and
1,087 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require('@rushstack/eslint-patch/modern-module-resolution') | ||
|
||
module.exports = { | ||
extends: [ | ||
'./.yarn/unplugged/@atls-config-eslint-npm-0.0.10-fcb02bb484/node_modules/@atls/config-eslint/dist/.eslintrc.js', | ||
], | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
}, | ||
ignorePatterns: ['.eslintrc.js'], | ||
} |
Binary file not shown.
Binary file added
BIN
+2.42 KB
.yarn/cache/@atls-config-prettier-npm-0.0.6-87618fdcac-db4f7b0eda.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+21.8 KB
.yarn/cache/@babel-helper-compilation-targets-npm-7.23.6-aa6f07f088-47b350d7b1.zip
Binary file not shown.
Binary file added
BIN
+4.32 KB
.yarn/cache/@babel-helper-environment-visitor-npm-7.22.20-260909e014-104196721e.zip
Binary file not shown.
Binary file added
BIN
+8.8 KB
.yarn/cache/@babel-helper-function-name-npm-7.23.0-ce38271242-be30108c93.zip
Binary file not shown.
Binary file added
BIN
+4.52 KB
.yarn/cache/@babel-helper-hoist-variables-npm-7.22.5-6db3192347-4df8aa58ae.zip
Binary file not shown.
Binary file added
BIN
+16.1 KB
.yarn/cache/@babel-helper-module-imports-npm-7.22.15-687e77ee50-b30edc03dc.zip
Binary file not shown.
Binary file added
BIN
+45.6 KB
.yarn/cache/@babel-helper-module-transforms-npm-7.23.3-69078a931c-8673845313.zip
Binary file not shown.
Binary file added
BIN
+5.93 KB
.yarn/cache/@babel-helper-simple-access-npm-7.22.5-0a3f578780-5a9c37a63b.zip
Binary file not shown.
Binary file added
BIN
+5.28 KB
.yarn/cache/@babel-helper-split-export-declaration-npm-7.22.6-e723505aef-35931a3825.zip
Binary file not shown.
Binary file added
BIN
+9.87 KB
.yarn/cache/@babel-helper-string-parser-npm-7.23.4-b1f0d030c3-20253f64c4.zip
Binary file not shown.
Binary file added
BIN
+17.7 KB
.yarn/cache/@babel-helper-validator-identifier-npm-7.22.20-18305bb306-7eb30962ba.zip
Binary file not shown.
Binary file added
BIN
+7.2 KB
.yarn/cache/@babel-helper-validator-option-npm-7.23.5-d83bbfe738-5671ddec7e.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+220 KB
.yarn/cache/@babel-runtime-corejs3-npm-7.23.7-8f3baead7d-3171582093.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+18 KB
.yarn/cache/@jridgewell-resolve-uri-npm-3.1.1-aa2de3f210-b3229d8567.zip
Binary file not shown.
Binary file added
BIN
+14.7 KB
.yarn/cache/@jridgewell-sourcemap-codec-npm-1.4.15-a055fb62cf-b71b5eeb0a.zip
Binary file not shown.
Binary file added
BIN
+44.4 KB
.yarn/cache/@jridgewell-trace-mapping-npm-0.3.20-d90f282910-7e517bcb75.zip
Binary file not shown.
Binary file renamed
BIN
+15.5 MB
...linux-x64-gnu-npm-12.3.4-97054948a9-9.zip → ...-darwin-arm64-npm-12.3.4-3c587df0e7-9.zip
Binary file not shown.
Binary file added
BIN
+76.5 KB
.yarn/cache/@rushstack-eslint-patch-npm-1.6.1-1f2a0c6119-e1b4d91a5f.zip
Binary file not shown.
Binary file added
BIN
+30.1 KB
.yarn/cache/@trivago-prettier-plugin-sort-imports-npm-3.4.0-62f73dbe3a-72ca67acea.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+712 KB
.yarn/cache/@typescript-eslint-eslint-plugin-npm-5.27.0-b70bbebb31-6a68d3001b.zip
Binary file not shown.
Binary file added
BIN
+12.9 KB
.yarn/cache/@typescript-eslint-parser-npm-5.27.0-8b2be72eb5-b99237c724.zip
Binary file not shown.
Binary file added
BIN
+302 KB
.yarn/cache/@typescript-eslint-scope-manager-npm-5.27.0-a71eee70fb-6da774e188.zip
Binary file not shown.
Binary file added
BIN
+49.5 KB
.yarn/cache/@typescript-eslint-type-utils-npm-5.27.0-4658cedc7f-f03cb08587.zip
Binary file not shown.
Binary file added
BIN
+28.9 KB
.yarn/cache/@typescript-eslint-types-npm-5.27.0-7594204beb-ae2b56e9bf.zip
Binary file not shown.
Binary file added
BIN
+127 KB
.yarn/cache/@typescript-eslint-typescript-estree-npm-5.27.0-fe031dffff-9541797227.zip
Binary file not shown.
Binary file added
BIN
+163 KB
.yarn/cache/@typescript-eslint-utils-npm-5.27.0-57e3df4654-6558841ff2.zip
Binary file not shown.
Binary file added
BIN
+9.25 KB
.yarn/cache/@typescript-eslint-visitor-keys-npm-5.27.0-612a63c484-500ebedb9e.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+5.75 KB
.yarn/cache/array-buffer-byte-length-npm-1.0.0-331671f28a-ff6fd5a168.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+11.3 KB
.yarn/cache/array.prototype.flatmap-npm-1.3.2-5c6a4af226-49f14393cb.zip
Binary file not shown.
Binary file added
BIN
+10.9 KB
.yarn/cache/arraybuffer.prototype.slice-npm-1.0.2-4eda52ad8c-32fe3b3227.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+7.58 KB
.yarn/cache/available-typed-arrays-npm-1.0.5-88f321e4d3-6b301a7ec3.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+36.4 KB
.yarn/cache/electron-to-chromium-npm-1.4.623-950fa7fa1c-9e6900f767.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.35 KB
.yarn/cache/eslint-import-resolver-node-npm-0.3.6-d9426786c6-5f4c14fab6.zip
Binary file not shown.
Binary file added
BIN
+3.32 KB
.yarn/cache/eslint-import-resolver-node-npm-0.3.9-2a426afc4b-8fd5324442.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+217 KB
.yarn/cache/eslint-plugin-jsx-a11y-npm-6.5.1-ea493bf2f2-4405fbbbb6.zip
Binary file not shown.
Binary file added
BIN
+15.9 KB
.yarn/cache/eslint-plugin-prettier-npm-4.0.0-e632552861-6793315a79.zip
Binary file not shown.
Binary file added
BIN
+32.5 KB
.yarn/cache/eslint-plugin-react-hooks-npm-4.5.0-e4de07a9f2-646ae980a0.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+13.8 KB
.yarn/cache/function.prototype.name-npm-1.1.6-fd3a6a5cdd-d56a9b8d6a.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.91 KB
.yarn/cache/get-symbol-description-npm-1.0.0-9c95a4bc1f-8164860450.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.54 KB
.yarn/cache/has-property-descriptors-npm-1.0.1-61cd62fce3-b626414717.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.86 KB
.yarn/cache/is-shared-array-buffer-npm-1.0.2-32e4181fcd-89167fd3a2.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+15.6 KB
.yarn/cache/javascript-natural-sort-npm-0.7.1-9018625996-1eef5ae7f3.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+192 KB
.yarn/cache/language-subtag-registry-npm-0.3.22-e9f79fe04e-5d97350e41.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.94 KB
.yarn/cache/prettier-linter-helpers-npm-1.0.0-6925131a7e-e9b17d00ae.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+15.8 KB
.yarn/cache/regexp.prototype.flags-npm-1.5.1-b8faeee306-f301249a06.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+15.5 KB
.yarn/cache/string.prototype.matchall-npm-4.0.10-197e4b9dad-f2fd320f61.zip
Binary file not shown.
Binary file added
BIN
+14.1 KB
.yarn/cache/string.prototype.trim-npm-1.2.8-7ed4517ce8-dcfd8b44bd.zip
Binary file not shown.
Binary file added
BIN
+11.4 KB
.yarn/cache/string.prototype.trimend-npm-1.0.7-159b9dcfbc-a34aa43e61.zip
Binary file not shown.
Binary file added
BIN
+11.5 KB
.yarn/cache/string.prototype.trimstart-npm-1.0.7-ae2f803b78-c583c7f1c0.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.31 KB
.yarn/cache/supports-preserve-symlinks-flag-npm-1.0.0-f17c4d0028-14609489b0.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.96 KB
.yarn/cache/typed-array-byte-length-npm-1.0.0-94d79975ca-08f7e32f82.zip
Binary file not shown.
Binary file added
BIN
+6.97 KB
.yarn/cache/typed-array-byte-offset-npm-1.0.0-8cbb911cf5-0cbc9090c4.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.57 KB
.yarn/cache/update-browserslist-db-npm-1.0.13-ea7b8ee24d-5f3d1aff5e.zip
Binary file not shown.
Binary file added
BIN
+7.98 KB
.yarn/cache/which-boxed-primitive-npm-1.0.2-e214f9ae5a-5dca8c7d5d.zip
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,11 @@ | |
}, | ||
"devDependencies": { | ||
"@atls/code-service": "0.0.23", | ||
"@atls/config-eslint": "0.0.10", | ||
"@atls/config-jest": "0.0.6", | ||
"@atls/schematics": "0.0.18", | ||
"@jest/core": "28.1.2", | ||
"@rushstack/eslint-patch": "1.6.1", | ||
"@types/eslint": "8.4.5", | ||
"@types/jest": "28.1.4", | ||
"@types/node": "18.0.3", | ||
|
@@ -24,7 +26,12 @@ | |
"husky": "8.0.1", | ||
"typescript": "4.6.2" | ||
}, | ||
"packageManager": "[email protected]", | ||
"dependenciesMeta": { | ||
"@atls/[email protected]": { | ||
"unplugged": true | ||
} | ||
}, | ||
"packageManager": "[email protected]", | ||
"tools": { | ||
"schematic": { | ||
"collection": "@atls/schematics", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,2 @@ | ||
import { Configuration } from '@ory/kratos-client' | ||
import { FrontendApi } from '@ory/kratos-client' | ||
|
||
import { getDomain } from 'tldjs' | ||
|
||
export class KratosClient extends FrontendApi { | ||
constructor({ basePath, ...props }: Partial<Configuration>) { | ||
if (!basePath && typeof window !== 'undefined') { | ||
const { hostname, protocol } = window.location | ||
|
||
if (hostname === 'localhost') { | ||
basePath = 'http://localhost:4433' // eslint-disable-line no-param-reassign | ||
} else if (hostname === '127.0.0.1') { | ||
basePath = 'http://127.0.0.1:4433' // eslint-disable-line no-param-reassign | ||
} else if (hostname.startsWith('accounts.')) { | ||
basePath = origin.replace('accounts.', 'identity.') // eslint-disable-line no-param-reassign | ||
} else { | ||
basePath = `${protocol}//identity.${getDomain(hostname)}` // eslint-disable-line no-param-reassign | ||
} | ||
} | ||
|
||
super(new Configuration({ basePath, ...props })) | ||
} | ||
} | ||
|
||
export const kratos = new KratosClient({}) | ||
export * from './kratos-admin.client' | ||
export * from './kratos.client' |
26 changes: 26 additions & 0 deletions
26
packages/identity-integration/src/sdk/kratos-admin.client.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Configuration } from '@ory/kratos-client' | ||
import { IdentityApi } from '@ory/kratos-client' | ||
|
||
import { getDomain } from 'tldjs' | ||
|
||
export class KratosAdminClient extends IdentityApi { | ||
constructor({ basePath, ...props }: Partial<Configuration>) { | ||
if (!basePath && typeof window !== 'undefined') { | ||
const { hostname, protocol } = window.location | ||
|
||
if (hostname === 'localhost') { | ||
basePath = 'http://localhost:4434' // eslint-disable-line no-param-reassign | ||
} else if (hostname === '127.0.0.1') { | ||
basePath = 'http://127.0.0.1:4434' // eslint-disable-line no-param-reassign | ||
} else if (hostname.startsWith('accounts.')) { | ||
basePath = origin.replace('accounts.', 'identity-admin.') // eslint-disable-line no-param-reassign | ||
} else { | ||
basePath = `${protocol}//identity-admin.${getDomain(hostname)}` // eslint-disable-line no-param-reassign | ||
} | ||
} | ||
|
||
super(new Configuration({ basePath, ...props })) | ||
} | ||
} | ||
|
||
export const kratosAdmin = new KratosAdminClient({}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Configuration } from '@ory/kratos-client' | ||
import { FrontendApi } from '@ory/kratos-client' | ||
|
||
import { getDomain } from 'tldjs' | ||
|
||
export class KratosClient extends FrontendApi { | ||
constructor({ basePath, ...props }: Partial<Configuration>) { | ||
if (!basePath && typeof window !== 'undefined') { | ||
const { hostname, protocol } = window.location | ||
|
||
if (hostname === 'localhost') { | ||
basePath = 'http://localhost:4433' // eslint-disable-line no-param-reassign | ||
} else if (hostname === '127.0.0.1') { | ||
basePath = 'http://127.0.0.1:4433' // eslint-disable-line no-param-reassign | ||
} else if (hostname.startsWith('accounts.')) { | ||
basePath = origin.replace('accounts.', 'identity.') // eslint-disable-line no-param-reassign | ||
} else { | ||
basePath = `${protocol}//identity.${getDomain(hostname)}` // eslint-disable-line no-param-reassign | ||
} | ||
} | ||
|
||
super(new Configuration({ basePath, ...props })) | ||
} | ||
} | ||
|
||
export const kratos = new KratosClient({}) |
Oops, something went wrong.