@authup/server-core 1.0.0-beta.61 → 1.0.0-beta.62
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/adapters/database/domains/client-scope/entity.d.ts.map +1 -1
- package/dist/adapters/database/domains/client-scope/entity.mjs +16 -8
- package/dist/adapters/database/domains/client-scope/entity.mjs.map +1 -1
- package/dist/adapters/database/domains/identity-provider-account/entity.d.ts.map +1 -1
- package/dist/adapters/database/domains/identity-provider-account/entity.mjs +1 -1
- package/dist/adapters/database/domains/identity-provider-account/entity.mjs.map +1 -1
- package/dist/adapters/database/migrations/mysql/1786631686318-SortIndexesAndAccountUniqueness.d.ts +50 -0
- package/dist/adapters/database/migrations/mysql/1786631686318-SortIndexesAndAccountUniqueness.d.ts.map +1 -0
- package/dist/adapters/database/migrations/mysql/1786631686318-SortIndexesAndAccountUniqueness.mjs +86 -0
- package/dist/adapters/database/migrations/mysql/1786631686318-SortIndexesAndAccountUniqueness.mjs.map +1 -0
- package/dist/adapters/database/migrations/postgres/1786631686318-SortIndexesAndAccountUniqueness.d.ts +42 -0
- package/dist/adapters/database/migrations/postgres/1786631686318-SortIndexesAndAccountUniqueness.d.ts.map +1 -0
- package/dist/adapters/database/migrations/postgres/1786631686318-SortIndexesAndAccountUniqueness.mjs +80 -0
- package/dist/adapters/database/migrations/postgres/1786631686318-SortIndexesAndAccountUniqueness.mjs.map +1 -0
- package/dist/adapters/http/adapters/oauth2/grant-types/utils/credentials.mjs +1 -1
- package/dist/adapters/http/adapters/oauth2/grant-types/utils/guess.mjs +1 -1
- package/dist/adapters/http/controllers/entities/client/module.mjs +2 -2
- package/dist/adapters/http/controllers/entities/identity-provider/module.d.ts +3 -5
- package/dist/adapters/http/controllers/entities/identity-provider/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/entities/identity-provider/module.mjs +54 -82
- package/dist/adapters/http/controllers/entities/identity-provider/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/entities/identity-provider/types.d.ts +6 -4
- package/dist/adapters/http/controllers/entities/identity-provider/types.d.ts.map +1 -1
- package/dist/adapters/http/controllers/entities/realm/module.mjs +2 -2
- package/dist/adapters/http/controllers/entities/session/module.mjs +2 -2
- package/dist/adapters/http/controllers/entities/user/module.mjs +2 -2
- package/dist/adapters/http/controllers/entities/user-authenticator/module.mjs +2 -2
- package/dist/adapters/http/controllers/workflows/authorize/module.d.ts.map +1 -1
- package/dist/adapters/http/controllers/workflows/authorize/module.mjs +9 -5
- package/dist/adapters/http/controllers/workflows/authorize/module.mjs.map +1 -1
- package/dist/adapters/http/controllers/workflows/token/utils/extract.mjs +2 -1
- package/dist/adapters/http/controllers/workflows/token/utils/extract.mjs.map +1 -1
- package/dist/adapters/http/middleware/built-in/assets.mjs +1 -1
- package/dist/adapters/http/request/helpers/param-id.d.ts.map +1 -1
- package/dist/adapters/http/request/helpers/param-id.mjs +2 -1
- package/dist/adapters/http/request/helpers/param-id.mjs.map +1 -1
- package/dist/adapters/http/ui/account-console/module.mjs +1 -1
- package/dist/adapters/http/ui/auth-console/http-client.mjs +1 -1
- package/dist/adapters/http/ui/auth-console/module.mjs +1 -1
- package/dist/adapters/http/ui/console-packages/module.d.ts +1 -1
- package/dist/adapters/http/ui/console-packages/module.mjs +2 -2
- package/dist/adapters/http/ui/console-packages/module.mjs.map +1 -1
- package/dist/adapters/http/ui/shared/html.d.ts.map +1 -1
- package/dist/adapters/http/ui/shared/html.mjs +1 -0
- package/dist/adapters/http/ui/shared/html.mjs.map +1 -1
- package/dist/app/modules/config/read/env.mjs +1 -1
- package/dist/app/modules/database/repositories/event/repository.d.ts +2 -2
- package/dist/app/modules/database/repositories/event/repository.d.ts.map +1 -1
- package/dist/app/modules/database/repositories/event/repository.mjs +23 -6
- package/dist/app/modules/database/repositories/event/repository.mjs.map +1 -1
- package/dist/app/modules/database/repositories/identity-provider-account/repository.d.ts.map +1 -1
- package/dist/app/modules/database/repositories/identity-provider-account/repository.mjs +9 -1
- package/dist/app/modules/database/repositories/identity-provider-account/repository.mjs.map +1 -1
- package/dist/app/modules/http/modules/controller.d.ts.map +1 -1
- package/dist/app/modules/http/modules/controller.mjs +16 -5
- package/dist/app/modules/http/modules/controller.mjs.map +1 -1
- package/dist/app/modules/identity/module.d.ts.map +1 -1
- package/dist/app/modules/identity/module.mjs +6 -3
- package/dist/app/modules/identity/module.mjs.map +1 -1
- package/dist/app/modules/identity/repositories/user.d.ts +1 -0
- package/dist/app/modules/identity/repositories/user.d.ts.map +1 -1
- package/dist/app/modules/identity/repositories/user.mjs +3 -0
- package/dist/app/modules/identity/repositories/user.mjs.map +1 -1
- package/dist/app/modules/oauth2/repositories/authorize/state/repository.d.ts +1 -2
- package/dist/app/modules/oauth2/repositories/authorize/state/repository.d.ts.map +1 -1
- package/dist/app/modules/oauth2/repositories/authorize/state/repository.mjs +7 -16
- package/dist/app/modules/oauth2/repositories/authorize/state/repository.mjs.map +1 -1
- package/dist/app/modules/runtime/module.mjs +2 -2
- package/dist/cli/commands/migration.mjs +1 -1
- package/dist/core/entities/client-scope/schema.d.ts.map +1 -1
- package/dist/core/entities/client-scope/schema.mjs +16 -1
- package/dist/core/entities/client-scope/schema.mjs.map +1 -1
- package/dist/core/entities/event/constants.d.ts +9 -0
- package/dist/core/entities/event/constants.d.ts.map +1 -1
- package/dist/core/entities/event/constants.mjs +9 -1
- package/dist/core/entities/event/constants.mjs.map +1 -1
- package/dist/core/entities/event/index.mjs +2 -2
- package/dist/core/entities/event/types.d.ts +11 -2
- package/dist/core/entities/event/types.d.ts.map +1 -1
- package/dist/core/entities/identity-provider-account/types.d.ts +6 -0
- package/dist/core/entities/identity-provider-account/types.d.ts.map +1 -1
- package/dist/core/entities/identity-provider-account/types.mjs.map +1 -1
- package/dist/core/entities/index.mjs +2 -2
- package/dist/core/identity/entities/user/types.d.ts +1 -0
- package/dist/core/identity/entities/user/types.d.ts.map +1 -1
- package/dist/core/identity/index.mjs +10 -10
- package/dist/core/identity/provider/account/module.d.ts +3 -0
- package/dist/core/identity/provider/account/module.d.ts.map +1 -1
- package/dist/core/identity/provider/account/module.mjs +54 -27
- package/dist/core/identity/provider/account/module.mjs.map +1 -1
- package/dist/core/identity/provider/account/types.d.ts +7 -0
- package/dist/core/identity/provider/account/types.d.ts.map +1 -1
- package/dist/core/identity/provider/authentication/index.mjs +1 -1
- package/dist/core/identity/provider/index.mjs +10 -10
- package/dist/core/index.mjs +14 -12
- package/dist/core/oauth2/authorization/code-request/verifier/module.d.ts.map +1 -1
- package/dist/core/oauth2/authorization/code-request/verifier/module.mjs +7 -1
- package/dist/core/oauth2/authorization/code-request/verifier/module.mjs.map +1 -1
- package/dist/core/oauth2/authorization/state/module.mjs +1 -2
- package/dist/core/oauth2/authorization/state/module.mjs.map +1 -1
- package/dist/core/oauth2/authorization/state/types.d.ts +5 -2
- package/dist/core/oauth2/authorization/state/types.d.ts.map +1 -1
- package/dist/core/oauth2/end-session/service.d.ts.map +1 -1
- package/dist/core/oauth2/end-session/service.mjs +1 -0
- package/dist/core/oauth2/end-session/service.mjs.map +1 -1
- package/dist/core/oauth2/federated-login/index.d.ts +3 -0
- package/dist/core/oauth2/federated-login/index.d.ts.map +1 -0
- package/dist/core/oauth2/federated-login/index.mjs +6 -0
- package/dist/core/oauth2/federated-login/module.d.ts +20 -0
- package/dist/core/oauth2/federated-login/module.d.ts.map +1 -0
- package/dist/core/oauth2/federated-login/module.mjs +137 -0
- package/dist/core/oauth2/federated-login/module.mjs.map +1 -0
- package/dist/core/oauth2/federated-login/types.d.ts +138 -0
- package/dist/core/oauth2/federated-login/types.d.ts.map +1 -0
- package/dist/core/oauth2/federated-login/types.mjs +31 -0
- package/dist/core/oauth2/federated-login/types.mjs.map +1 -0
- package/dist/core/oauth2/index.d.ts +1 -0
- package/dist/core/oauth2/index.d.ts.map +1 -1
- package/dist/core/oauth2/index.mjs +4 -1
- package/dist/core/provisioning/entities/policy/validator.d.ts.map +1 -1
- package/dist/core/provisioning/entities/policy/validator.mjs +2 -1
- package/dist/core/provisioning/entities/policy/validator.mjs.map +1 -1
- package/dist/core/provisioning/entities/realm/wildcard-validator.d.ts.map +1 -1
- package/dist/core/provisioning/entities/realm/wildcard-validator.mjs +2 -1
- package/dist/core/provisioning/entities/realm/wildcard-validator.mjs.map +1 -1
- package/dist/core/security/policy/evaluator.mjs.map +1 -1
- package/dist/node_modules/@ebec/core/dist/index.mjs +130 -0
- package/dist/node_modules/@ebec/core/dist/index.mjs.map +1 -0
- package/dist/swagger.json +30 -2
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/utils/error.mjs +5 -6
- package/dist/utils/error.mjs.map +1 -1
- package/package.json +28 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/database/domains/client-scope/entity.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EACR,MAAM,EACN,WAAW,EACX,KAAK,EACL,KAAK,EACR,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,qBAEa,iBAAkB,YAAW,WAAW;IAEjD,EAAE,EAAE,MAAM,CAAC;IAOX,OAAO,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/database/domains/client-scope/entity.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EACR,MAAM,EACN,WAAW,EACX,KAAK,EACL,KAAK,EACR,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,qBAEa,iBAAkB,YAAW,WAAW;IAEjD,EAAE,EAAE,MAAM,CAAC;IAOX,OAAO,EAAE,OAAO,CAAC;IAMjB,SAAS,EAAE,MAAM,CAAC;IAIlB,SAAS,EAAE,MAAM,CAAC;IAKlB,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAIvB,MAAM,EAAE,MAAM,CAAC;IAIf,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAOlC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAMhC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAIrB,KAAK,EAAE,KAAK,CAAC;IAIb,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAOjC,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;CAClC"}
|
|
@@ -43,14 +43,22 @@ _ts_decorate([
|
|
|
43
43
|
}),
|
|
44
44
|
_ts_metadata("design:type", Boolean)
|
|
45
45
|
], ClientScopeEntity.prototype, "default", void 0);
|
|
46
|
-
_ts_decorate([
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
_ts_decorate([
|
|
47
|
+
Index(),
|
|
48
|
+
CreateDateColumn({
|
|
49
|
+
name: "created_at",
|
|
50
|
+
transformer: dateToISOStringTransformer
|
|
51
|
+
}),
|
|
52
|
+
_ts_metadata("design:type", String)
|
|
53
|
+
], ClientScopeEntity.prototype, "createdAt", void 0);
|
|
54
|
+
_ts_decorate([
|
|
55
|
+
Index(),
|
|
56
|
+
UpdateDateColumn({
|
|
57
|
+
name: "updated_at",
|
|
58
|
+
transformer: dateToISOStringTransformer
|
|
59
|
+
}),
|
|
60
|
+
_ts_metadata("design:type", String)
|
|
61
|
+
], ClientScopeEntity.prototype, "updatedAt", void 0);
|
|
54
62
|
_ts_decorate([Column({ name: "client_id" }), _ts_metadata("design:type", Object)], ClientScopeEntity.prototype, "clientId", void 0);
|
|
55
63
|
_ts_decorate([
|
|
56
64
|
ManyToOne(() => ClientEntity, { onDelete: "CASCADE" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.mjs","names":["Column","CreateDateColumn","Entity","Index","JoinColumn","ManyToOne","PrimaryGeneratedColumn","Unique","UpdateDateColumn","dateToISOStringTransformer","ClientEntity","RealmEntity","ScopeEntity","ClientScopeEntity","id","default","createdAt","updatedAt","clientId","client","clientRealmId","clientRealm","scopeId","scope","scopeRealmId","scopeRealm","type","name","transformer","onDelete","nullable"],"sources":["../../../../../src/adapters/database/domains/client-scope/entity.ts"],"sourcesContent":["/*\n * Copyright (c) 2021-2021.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n JoinColumn,\n ManyToOne,\n PrimaryGeneratedColumn,\n Unique,\n UpdateDateColumn,\n} from 'typeorm';\nimport { dateToISOStringTransformer } from '../../helpers/index.ts';\nimport type {\n Client,\n ClientScope,\n Realm,\n Scope,\n} from '@authup/core-kit';\nimport { ClientEntity } from '../client/index.ts';\nimport { RealmEntity } from '../realm/index.ts';\nimport { ScopeEntity } from '../scope/index.ts';\n\n@Entity({ name: 'auth_client_scopes' })\n@Unique(['clientId', 'scopeId'])\nexport class ClientScopeEntity implements ClientScope {\n @PrimaryGeneratedColumn('uuid')\n id: string;\n\n @Index()\n @Column({\n type: 'boolean',\n default: false, \n })\n default: boolean;\n\n // ------------------------------------------------------------------\n\n @CreateDateColumn({ name: 'created_at', transformer: dateToISOStringTransformer })\n createdAt: string;\n\n @UpdateDateColumn({ name: 'updated_at', transformer: dateToISOStringTransformer })\n updatedAt: string;\n\n // ------------------------------------------------------------------\n\n @Column({ name: 'client_id' })\n clientId: Client['id'];\n\n @ManyToOne(() => ClientEntity, { onDelete: 'CASCADE' })\n @JoinColumn({ name: 'client_id' })\n client: Client;\n\n @Index()\n @Column({ name: 'client_realm_id', nullable: true })\n clientRealmId: Realm['id'] | null;\n\n @ManyToOne(() => RealmEntity, {\n onDelete: 'CASCADE',\n nullable: true, \n })\n @JoinColumn({ name: 'client_realm_id' })\n clientRealm: RealmEntity | null;\n\n // ------------------------------------------------------------------\n\n @Index()\n @Column({ name: 'scope_id' })\n scopeId: Scope['id'];\n\n @ManyToOne(() => ScopeEntity, { onDelete: 'CASCADE' })\n @JoinColumn({ name: 'scope_id' })\n scope: Scope;\n\n @Index()\n @Column({ name: 'scope_realm_id', nullable: true })\n scopeRealmId: Realm['id'] | null;\n\n @ManyToOne(() => RealmEntity, {\n onDelete: 'CASCADE',\n nullable: true, \n })\n @JoinColumn({ name: 'scope_realm_id' })\n scopeRealm: RealmEntity | null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAaa,oBAAb,MAAaA;CAETC;CAOAC;
|
|
1
|
+
{"version":3,"file":"entity.mjs","names":["Column","CreateDateColumn","Entity","Index","JoinColumn","ManyToOne","PrimaryGeneratedColumn","Unique","UpdateDateColumn","dateToISOStringTransformer","ClientEntity","RealmEntity","ScopeEntity","ClientScopeEntity","id","default","createdAt","updatedAt","clientId","client","clientRealmId","clientRealm","scopeId","scope","scopeRealmId","scopeRealm","type","name","transformer","onDelete","nullable"],"sources":["../../../../../src/adapters/database/domains/client-scope/entity.ts"],"sourcesContent":["/*\n * Copyright (c) 2021-2021.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n JoinColumn,\n ManyToOne,\n PrimaryGeneratedColumn,\n Unique,\n UpdateDateColumn,\n} from 'typeorm';\nimport { dateToISOStringTransformer } from '../../helpers/index.ts';\nimport type {\n Client,\n ClientScope,\n Realm,\n Scope,\n} from '@authup/core-kit';\nimport { ClientEntity } from '../client/index.ts';\nimport { RealmEntity } from '../realm/index.ts';\nimport { ScopeEntity } from '../scope/index.ts';\n\n@Entity({ name: 'auth_client_scopes' })\n@Unique(['clientId', 'scopeId'])\nexport class ClientScopeEntity implements ClientScope {\n @PrimaryGeneratedColumn('uuid')\n id: string;\n\n @Index()\n @Column({\n type: 'boolean',\n default: false, \n })\n default: boolean;\n\n // ------------------------------------------------------------------\n\n @Index()\n @CreateDateColumn({ name: 'created_at', transformer: dateToISOStringTransformer })\n createdAt: string;\n\n @Index()\n @UpdateDateColumn({ name: 'updated_at', transformer: dateToISOStringTransformer })\n updatedAt: string;\n\n // ------------------------------------------------------------------\n\n @Column({ name: 'client_id' })\n clientId: Client['id'];\n\n @ManyToOne(() => ClientEntity, { onDelete: 'CASCADE' })\n @JoinColumn({ name: 'client_id' })\n client: Client;\n\n @Index()\n @Column({ name: 'client_realm_id', nullable: true })\n clientRealmId: Realm['id'] | null;\n\n @ManyToOne(() => RealmEntity, {\n onDelete: 'CASCADE',\n nullable: true, \n })\n @JoinColumn({ name: 'client_realm_id' })\n clientRealm: RealmEntity | null;\n\n // ------------------------------------------------------------------\n\n @Index()\n @Column({ name: 'scope_id' })\n scopeId: Scope['id'];\n\n @ManyToOne(() => ScopeEntity, { onDelete: 'CASCADE' })\n @JoinColumn({ name: 'scope_id' })\n scope: Scope;\n\n @Index()\n @Column({ name: 'scope_realm_id', nullable: true })\n scopeRealmId: Realm['id'] | null;\n\n @ManyToOne(() => RealmEntity, {\n onDelete: 'CASCADE',\n nullable: true, \n })\n @JoinColumn({ name: 'scope_realm_id' })\n scopeRealm: RealmEntity | null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAaa,oBAAb,MAAaA;CAETC;CAOAC;CAMAC;CAIAC;CAKAC;CAIAC;CAIAC;CAOAC;CAMAC;CAIAC;CAIAC;CAOAC;AACJ;;;;;EAvDQC,MAAM;EACNX,SAAS;;;;;;;EAOOY,MAAM;EAAcC,aAAanB;;;;;;;EAIjCkB,MAAM;EAAcC,aAAanB;;;;AAK3CkB,aAAAA,CAAAA,OAAAA,EAAAA,MAAM,YAAA,CAAA,GAAA,aAAA,eAAA,MAAA,CAAA,GAAA,kBAAA,WAAA,YAAA,KAAA,CAAA;;CAGCjB,gBAAAA,cAAAA,EAAgBmB,UAAU,UAAA,CAAA;CAC7BF,WAAAA,EAAAA,MAAM,YAAA,CAAA;;;;;;EAIVA,MAAM;EAAmBG,UAAU;;;;;CAG5BnB,gBAAAA,aAAAA;EACbkB,UAAU;EACVC,UAAU;;CAEAH,WAAAA,EAAAA,MAAM,kBAAA,CAAA;;;;;CAMVA,OAAAA,EAAAA,MAAM,WAAA,CAAA;;;;CAGCf,gBAAAA,aAAAA,EAAeiB,UAAU,UAAA,CAAA;CAC5BF,WAAAA,EAAAA,MAAM,WAAA,CAAA;;;;;;EAIVA,MAAM;EAAkBG,UAAU;;;;;CAG3BnB,gBAAAA,aAAAA;EACbkB,UAAU;EACVC,UAAU;;CAEAH,WAAAA,EAAAA,MAAM,iBAAA,CAAA;;;AA7DdA,oBAAAA,aAAAA,CAAAA,OAAAA,EAAAA,MAAM,qBAAA,CAAA,GAAA,OAAA,CACP,YAAY,SAAA,CAAA,CAAA,GAAA,iBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/database/domains/identity-provider-account/entity.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAER,gBAAgB,EAChB,uBAAuB,EACvB,KAAK,EACL,IAAI,EACP,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/database/domains/identity-provider-account/entity.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAER,gBAAgB,EAChB,uBAAuB,EACvB,KAAK,EACL,IAAI,EACP,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,qBAMa,6BAA8B,YAAW,uBAAuB;IAEzE,EAAE,EAAE,MAAM,CAAC;IASX,WAAW,EAAE,MAAM,CAAC;IASpB,YAAY,EAAE,MAAM,CAAC;IAOrB,cAAc,EAAE,MAAM,CAAC;IASvB,gBAAgB,EAAE,MAAM,CAAC;IASzB,iBAAiB,EAAE,MAAM,CAAC;IAU1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAUzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAIzB,SAAS,EAAE,MAAM,CAAC;IAIlB,SAAS,EAAE,MAAM,CAAC;IAMlB,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAInB,IAAI,EAAE,UAAU,CAAC;IAIjB,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAOhC,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAK9B,UAAU,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAInC,QAAQ,EAAE,sBAAsB,CAAC;IAIjC,eAAe,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAOpC,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC;CACrC"}
|
|
@@ -157,7 +157,7 @@ _ts_decorate([
|
|
|
157
157
|
IdentityProviderAccountEntity = _ts_decorate([
|
|
158
158
|
Entity({ name: "auth_identity_provider_accounts" }),
|
|
159
159
|
Index(["providerId", "userId"], { unique: true }),
|
|
160
|
-
Index(["providerUserId", "providerId"])
|
|
160
|
+
Index(["providerUserId", "providerId"], { unique: true })
|
|
161
161
|
], IdentityProviderAccountEntity);
|
|
162
162
|
//#endregion
|
|
163
163
|
export { IdentityProviderAccountEntity };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.mjs","names":["Column","CreateDateColumn","Entity","Index","JoinColumn","ManyToOne","PrimaryGeneratedColumn","UpdateDateColumn","dateToISOStringTransformer","RealmEntity","UserEntity","IdentityProviderEntity","IdentityProviderAccountEntity","id","accessToken","refreshToken","providerUserId","providerUserName","providerUserEmail","expiresIn","expiresAt","createdAt","updatedAt","userId","user","userRealmId","userRealm","providerId","provider","providerRealmId","providerRealm","name","type","nullable","default","select","length","unsigned","transformer","onDelete","unique"],"sources":["../../../../../src/adapters/database/domains/identity-provider-account/entity.ts"],"sourcesContent":["/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n JoinColumn,\n ManyToOne,\n PrimaryGeneratedColumn,\n UpdateDateColumn,\n} from 'typeorm';\nimport { dateToISOStringTransformer } from '../../helpers/index.ts';\nimport type {\n \n IdentityProvider, \n IdentityProviderAccount, \n Realm, \n User, \n} from '@authup/core-kit';\nimport { RealmEntity } from '../realm/index.ts';\nimport { UserEntity } from '../user/index.ts';\nimport { IdentityProviderEntity } from '../identity-provider/index.ts';\n\n@Entity({ name: 'auth_identity_provider_accounts' })\n@Index(['providerId', 'userId'], { unique: true })\n@Index(['providerUserId', 'providerId'])\nexport class IdentityProviderAccountEntity implements IdentityProviderAccount {\n @PrimaryGeneratedColumn('uuid')\n id: string;\n\n @Column({\n name: 'access_token',\n type: 'text',\n nullable: true,\n default: null,\n select: false,\n })\n accessToken: string;\n\n @Column({\n name: 'refresh_token',\n type: 'text',\n nullable: true,\n default: null,\n select: false,\n })\n refreshToken: string;\n\n @Column({\n name: 'provider_user_id', \n type: 'varchar', \n length: 256, \n })\n providerUserId: string;\n\n @Column({\n name: 'provider_user_name', \n type: 'varchar', \n length: 256, \n nullable: true, \n default: null, \n })\n providerUserName: string;\n\n @Column({\n name: 'provider_user_email', \n type: 'varchar', \n length: 512, \n nullable: true, \n default: null, \n })\n providerUserEmail: string;\n\n @Column({\n name: 'expires_in',\n type: 'int',\n unsigned: true,\n nullable: true,\n default: null,\n select: false,\n })\n expiresIn: number | null;\n\n @Column({\n name: 'expires_at',\n type: 'varchar',\n length: 28,\n nullable: true,\n default: null,\n select: false,\n })\n expiresAt: string | null;\n\n @Index()\n @CreateDateColumn({ name: 'created_at', transformer: dateToISOStringTransformer })\n createdAt: string;\n\n @Index()\n @UpdateDateColumn({ name: 'updated_at', transformer: dateToISOStringTransformer })\n updatedAt: string;\n\n // -----------------------------------------------\n\n @Index()\n @Column({ name: 'user_id' })\n userId: User['id'];\n\n @ManyToOne(() => UserEntity, { onDelete: 'CASCADE' })\n @JoinColumn({ name: 'user_id' })\n user: UserEntity;\n\n @Index()\n @Column({ name: 'user_realm_id', nullable: true })\n userRealmId: Realm['id'] | null;\n\n @ManyToOne(() => RealmEntity, {\n onDelete: 'CASCADE',\n nullable: true, \n })\n @JoinColumn({ name: 'user_realm_id' })\n userRealm: RealmEntity | null;\n\n // -----------------------------------------------\n\n @Column({ name: 'provider_id' })\n providerId: IdentityProvider['id'];\n\n @ManyToOne(() => IdentityProviderEntity, { onDelete: 'CASCADE' })\n @JoinColumn({ name: 'provider_id' })\n provider: IdentityProviderEntity;\n\n @Index()\n @Column({ name: 'provider_realm_id', nullable: true })\n providerRealmId: Realm['id'] | null;\n\n @ManyToOne(() => RealmEntity, {\n onDelete: 'CASCADE',\n nullable: true, \n })\n @JoinColumn({ name: 'provider_realm_id' })\n providerRealm: RealmEntity | null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"entity.mjs","names":["Column","CreateDateColumn","Entity","Index","JoinColumn","ManyToOne","PrimaryGeneratedColumn","UpdateDateColumn","dateToISOStringTransformer","RealmEntity","UserEntity","IdentityProviderEntity","IdentityProviderAccountEntity","id","accessToken","refreshToken","providerUserId","providerUserName","providerUserEmail","expiresIn","expiresAt","createdAt","updatedAt","userId","user","userRealmId","userRealm","providerId","provider","providerRealmId","providerRealm","name","type","nullable","default","select","length","unsigned","transformer","onDelete","unique"],"sources":["../../../../../src/adapters/database/domains/identity-provider-account/entity.ts"],"sourcesContent":["/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n JoinColumn,\n ManyToOne,\n PrimaryGeneratedColumn,\n UpdateDateColumn,\n} from 'typeorm';\nimport { dateToISOStringTransformer } from '../../helpers/index.ts';\nimport type {\n \n IdentityProvider, \n IdentityProviderAccount, \n Realm, \n User, \n} from '@authup/core-kit';\nimport { RealmEntity } from '../realm/index.ts';\nimport { UserEntity } from '../user/index.ts';\nimport { IdentityProviderEntity } from '../identity-provider/index.ts';\n\n@Entity({ name: 'auth_identity_provider_accounts' })\n@Index(['providerId', 'userId'], { unique: true })\n// one external identity belongs to one local user. The column order is\n// load-bearing: `providerUserId` leads the sequence the rapiq schema\n// declares, and reversing it would fail the boot-time index assertion.\n@Index(['providerUserId', 'providerId'], { unique: true })\nexport class IdentityProviderAccountEntity implements IdentityProviderAccount {\n @PrimaryGeneratedColumn('uuid')\n id: string;\n\n @Column({\n name: 'access_token',\n type: 'text',\n nullable: true,\n default: null,\n select: false,\n })\n accessToken: string;\n\n @Column({\n name: 'refresh_token',\n type: 'text',\n nullable: true,\n default: null,\n select: false,\n })\n refreshToken: string;\n\n @Column({\n name: 'provider_user_id', \n type: 'varchar', \n length: 256, \n })\n providerUserId: string;\n\n @Column({\n name: 'provider_user_name', \n type: 'varchar', \n length: 256, \n nullable: true, \n default: null, \n })\n providerUserName: string;\n\n @Column({\n name: 'provider_user_email', \n type: 'varchar', \n length: 512, \n nullable: true, \n default: null, \n })\n providerUserEmail: string;\n\n @Column({\n name: 'expires_in',\n type: 'int',\n unsigned: true,\n nullable: true,\n default: null,\n select: false,\n })\n expiresIn: number | null;\n\n @Column({\n name: 'expires_at',\n type: 'varchar',\n length: 28,\n nullable: true,\n default: null,\n select: false,\n })\n expiresAt: string | null;\n\n @Index()\n @CreateDateColumn({ name: 'created_at', transformer: dateToISOStringTransformer })\n createdAt: string;\n\n @Index()\n @UpdateDateColumn({ name: 'updated_at', transformer: dateToISOStringTransformer })\n updatedAt: string;\n\n // -----------------------------------------------\n\n @Index()\n @Column({ name: 'user_id' })\n userId: User['id'];\n\n @ManyToOne(() => UserEntity, { onDelete: 'CASCADE' })\n @JoinColumn({ name: 'user_id' })\n user: UserEntity;\n\n @Index()\n @Column({ name: 'user_realm_id', nullable: true })\n userRealmId: Realm['id'] | null;\n\n @ManyToOne(() => RealmEntity, {\n onDelete: 'CASCADE',\n nullable: true, \n })\n @JoinColumn({ name: 'user_realm_id' })\n userRealm: RealmEntity | null;\n\n // -----------------------------------------------\n\n @Column({ name: 'provider_id' })\n providerId: IdentityProvider['id'];\n\n @ManyToOne(() => IdentityProviderEntity, { onDelete: 'CASCADE' })\n @JoinColumn({ name: 'provider_id' })\n provider: IdentityProviderEntity;\n\n @Index()\n @Column({ name: 'provider_realm_id', nullable: true })\n providerRealmId: Realm['id'] | null;\n\n @ManyToOne(() => RealmEntity, {\n onDelete: 'CASCADE',\n nullable: true, \n })\n @JoinColumn({ name: 'provider_realm_id' })\n providerRealm: RealmEntity | null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmCA,IAAaY,gCAAb,MAAaA;CAETC;CASAC;CASAC;CAOAC;CASAC;CASAC;CAUAC;CAUAC;CAIAC;CAIAC;CAMAC;CAIAC;CAIAC;CAOAC;CAKAC;CAIAC;CAIAC;CAOAC;AACJ;;;CA9GQC,MAAM;CACNC,MAAM;CACNC,UAAU;CACVC,SAAS;CACTC,QAAQ;;;CAKRJ,MAAM;CACNC,MAAM;CACNC,UAAU;CACVC,SAAS;CACTC,QAAQ;;;CAKRJ,MAAM;CACNC,MAAM;CACNI,QAAQ;;;CAKRL,MAAM;CACNC,MAAM;CACNI,QAAQ;CACRH,UAAU;CACVC,SAAS;;;CAKTH,MAAM;CACNC,MAAM;CACNI,QAAQ;CACRH,UAAU;CACVC,SAAS;;;CAKTH,MAAM;CACNC,MAAM;CACNK,UAAU;CACVJ,UAAU;CACVC,SAAS;CACTC,QAAQ;;;CAKRJ,MAAM;CACNC,MAAM;CACNI,QAAQ;CACRH,UAAU;CACVC,SAAS;CACTC,QAAQ;;;;;EAKQJ,MAAM;EAAcO,aAAa9B;;;;;;;EAIjCuB,MAAM;EAAcO,aAAa9B;;;;;;CAM3CuB,OAAAA,EAAAA,MAAM,UAAA,CAAA;;;;CAGCrB,gBAAAA,YAAAA,EAAc6B,UAAU,UAAA,CAAA;CAC3BR,WAAAA,EAAAA,MAAM,UAAA,CAAA;;;;;;EAIVA,MAAM;EAAiBE,UAAU;;;;;CAG1BxB,gBAAAA,aAAAA;EACb8B,UAAU;EACVN,UAAU;;CAEAF,WAAAA,EAAAA,MAAM,gBAAA,CAAA;;;AAKVA,aAAAA,CAAAA,OAAAA,EAAAA,MAAM,cAAA,CAAA,GAAA,aAAA,eAAA,MAAA,CAAA,GAAA,8BAAA,WAAA,cAAA,KAAA,CAAA;;CAGCpB,gBAAAA,wBAAAA,EAA0B4B,UAAU,UAAA,CAAA;CACvCR,WAAAA,EAAAA,MAAM,cAAA,CAAA;;;;;;EAIVA,MAAM;EAAqBE,UAAU;;;;;CAG9BxB,gBAAAA,aAAAA;EACb8B,UAAU;EACVN,UAAU;;CAEAF,WAAAA,EAAAA,MAAM,oBAAA,CAAA;;;;CAvHdA,OAAAA,EAAAA,MAAM,kCAAA,CAAA;CACR,MAAA,CAAA,cAAc,QAAA,GAAA,EAAaS,QAAQ,KAAA,CAAA;CAInC,MAAA,CAAA,kBAAkB,YAAA,GAAA,EAAiBA,QAAQ,KAAA,CAAA"}
|
package/dist/adapters/database/migrations/mysql/1786631686318-SortIndexesAndAccountUniqueness.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Client-scope sort indexes (issue #3441) and identity-provider account
|
|
4
|
+
* uniqueness (issue #3442).
|
|
5
|
+
*
|
|
6
|
+
* - Indexes `auth_client_scopes.created_at` and `updated_at`.
|
|
7
|
+
* `clientScopeSchema` was the only registered schema with no `sorts`
|
|
8
|
+
* allow-list, so rapiq fell back to a syntactic name check and handed an
|
|
9
|
+
* arbitrary `?sort=` key to `ORDER BY`. Declaring the allow-list requires
|
|
10
|
+
* every listed key to lead a real entity index; the two timestamp columns
|
|
11
|
+
* were the only ones missing theirs.
|
|
12
|
+
* - Makes `(provider_user_id, provider_id)` unique on
|
|
13
|
+
* `auth_identity_provider_accounts`. "One external identity belongs to one
|
|
14
|
+
* local user" was enforced only by a read-then-write in
|
|
15
|
+
* `IdentityProviderAccountManager`: no transaction, no row lock, and
|
|
16
|
+
* nothing behind it in the schema, so two concurrent completions for the
|
|
17
|
+
* same upstream subject could both observe "not linked" and both insert.
|
|
18
|
+
* After that the subject resolves to whichever row the database happens to
|
|
19
|
+
* order first. The column order matches the pre-existing non-unique index,
|
|
20
|
+
* so this is an in-place uniqueness flip under the same derived name
|
|
21
|
+
* rather than a rename.
|
|
22
|
+
*
|
|
23
|
+
* MySQL commits DDL implicitly, so `migrationsTransactionMode: 'all'` cannot
|
|
24
|
+
* roll a partial run back. A DROP followed by a CREATE would leave the table
|
|
25
|
+
* with no index of that name if the process died between them, and every
|
|
26
|
+
* later attempt would then fail at the DROP. One ALTER carrying both is
|
|
27
|
+
* atomic, so the uniqueness flip either applies or does not.
|
|
28
|
+
*
|
|
29
|
+
* Pre-existing duplicates abort the boot with an actionable message. They
|
|
30
|
+
* would abort it anyway, since `CREATE UNIQUE INDEX` fails on them; the
|
|
31
|
+
* check only decides whether the operator reads a readable sentence or a
|
|
32
|
+
* hash-named driver error.
|
|
33
|
+
*
|
|
34
|
+
* It runs BEFORE any DDL for the same implicit-commit reason: an abort
|
|
35
|
+
* after the two CREATE INDEX statements leaves them committed while the
|
|
36
|
+
* migration stays unapplied, so the operator's retry — after cleaning the
|
|
37
|
+
* duplicates — would die on `Duplicate key name` and never reach the flip.
|
|
38
|
+
* Nothing here writes before the check, so a refusal leaves the schema
|
|
39
|
+
* exactly as it was.
|
|
40
|
+
*
|
|
41
|
+
* Generated with `migration generate`; derived IDX_<hash> names, generated
|
|
42
|
+
* DDL untouched (the duplicate pre-check and the single-ALTER flip are
|
|
43
|
+
* hand-authored).
|
|
44
|
+
*/
|
|
45
|
+
export declare class SortIndexesAndAccountUniqueness1786631686318 implements MigrationInterface {
|
|
46
|
+
name: string;
|
|
47
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
48
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=1786631686318-SortIndexesAndAccountUniqueness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1786631686318-SortIndexesAndAccountUniqueness.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/database/migrations/mysql/1786631686318-SortIndexesAndAccountUniqueness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,qBAAa,4CAA6C,YAAW,kBAAkB;IACnF,IAAI,SAAkD;IAEzC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAa7D"}
|
package/dist/adapters/database/migrations/mysql/1786631686318-SortIndexesAndAccountUniqueness.mjs
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/adapters/database/migrations/mysql/1786631686318-SortIndexesAndAccountUniqueness.ts
|
|
5
|
+
/**
|
|
6
|
+
* Client-scope sort indexes (issue #3441) and identity-provider account
|
|
7
|
+
* uniqueness (issue #3442).
|
|
8
|
+
*
|
|
9
|
+
* - Indexes `auth_client_scopes.created_at` and `updated_at`.
|
|
10
|
+
* `clientScopeSchema` was the only registered schema with no `sorts`
|
|
11
|
+
* allow-list, so rapiq fell back to a syntactic name check and handed an
|
|
12
|
+
* arbitrary `?sort=` key to `ORDER BY`. Declaring the allow-list requires
|
|
13
|
+
* every listed key to lead a real entity index; the two timestamp columns
|
|
14
|
+
* were the only ones missing theirs.
|
|
15
|
+
* - Makes `(provider_user_id, provider_id)` unique on
|
|
16
|
+
* `auth_identity_provider_accounts`. "One external identity belongs to one
|
|
17
|
+
* local user" was enforced only by a read-then-write in
|
|
18
|
+
* `IdentityProviderAccountManager`: no transaction, no row lock, and
|
|
19
|
+
* nothing behind it in the schema, so two concurrent completions for the
|
|
20
|
+
* same upstream subject could both observe "not linked" and both insert.
|
|
21
|
+
* After that the subject resolves to whichever row the database happens to
|
|
22
|
+
* order first. The column order matches the pre-existing non-unique index,
|
|
23
|
+
* so this is an in-place uniqueness flip under the same derived name
|
|
24
|
+
* rather than a rename.
|
|
25
|
+
*
|
|
26
|
+
* MySQL commits DDL implicitly, so `migrationsTransactionMode: 'all'` cannot
|
|
27
|
+
* roll a partial run back. A DROP followed by a CREATE would leave the table
|
|
28
|
+
* with no index of that name if the process died between them, and every
|
|
29
|
+
* later attempt would then fail at the DROP. One ALTER carrying both is
|
|
30
|
+
* atomic, so the uniqueness flip either applies or does not.
|
|
31
|
+
*
|
|
32
|
+
* Pre-existing duplicates abort the boot with an actionable message. They
|
|
33
|
+
* would abort it anyway, since `CREATE UNIQUE INDEX` fails on them; the
|
|
34
|
+
* check only decides whether the operator reads a readable sentence or a
|
|
35
|
+
* hash-named driver error.
|
|
36
|
+
*
|
|
37
|
+
* It runs BEFORE any DDL for the same implicit-commit reason: an abort
|
|
38
|
+
* after the two CREATE INDEX statements leaves them committed while the
|
|
39
|
+
* migration stays unapplied, so the operator's retry — after cleaning the
|
|
40
|
+
* duplicates — would die on `Duplicate key name` and never reach the flip.
|
|
41
|
+
* Nothing here writes before the check, so a refusal leaves the schema
|
|
42
|
+
* exactly as it was.
|
|
43
|
+
*
|
|
44
|
+
* Generated with `migration generate`; derived IDX_<hash> names, generated
|
|
45
|
+
* DDL untouched (the duplicate pre-check and the single-ALTER flip are
|
|
46
|
+
* hand-authored).
|
|
47
|
+
*/ var SortIndexesAndAccountUniqueness1786631686318 = class {
|
|
48
|
+
name = "SortIndexesAndAccountUniqueness1786631686318";
|
|
49
|
+
async up(queryRunner) {
|
|
50
|
+
const duplicates = await queryRunner.query(`
|
|
51
|
+
SELECT \`provider_id\`, \`provider_user_id\`, COUNT(*) AS \`count\`
|
|
52
|
+
FROM \`auth_identity_provider_accounts\`
|
|
53
|
+
GROUP BY \`provider_id\`, \`provider_user_id\`
|
|
54
|
+
HAVING COUNT(*) > 1
|
|
55
|
+
`);
|
|
56
|
+
if (duplicates.length > 0) throw new Error(`Identity-provider account uniqueness migration aborted: "auth_identity_provider_accounts" holds ${duplicates.length} duplicate (provider_id, provider_user_id) group(s). One external identity must belong to one local user. Merge or delete the conflicting rows manually before re-running.`);
|
|
57
|
+
await queryRunner.query(`
|
|
58
|
+
CREATE INDEX \`IDX_52f59535945c8cdbd62439bba5\` ON \`auth_client_scopes\` (\`created_at\`)
|
|
59
|
+
`);
|
|
60
|
+
await queryRunner.query(`
|
|
61
|
+
CREATE INDEX \`IDX_04264aebc8b6625b1da88e23df\` ON \`auth_client_scopes\` (\`updated_at\`)
|
|
62
|
+
`);
|
|
63
|
+
await queryRunner.query(`
|
|
64
|
+
ALTER TABLE \`auth_identity_provider_accounts\`
|
|
65
|
+
DROP INDEX \`IDX_ccf3fd36253755bd9a5f43c516\`,
|
|
66
|
+
ADD UNIQUE INDEX \`IDX_ccf3fd36253755bd9a5f43c516\` (\`provider_user_id\`, \`provider_id\`)
|
|
67
|
+
`);
|
|
68
|
+
}
|
|
69
|
+
async down(queryRunner) {
|
|
70
|
+
await queryRunner.query(`
|
|
71
|
+
ALTER TABLE \`auth_identity_provider_accounts\`
|
|
72
|
+
DROP INDEX \`IDX_ccf3fd36253755bd9a5f43c516\`,
|
|
73
|
+
ADD INDEX \`IDX_ccf3fd36253755bd9a5f43c516\` (\`provider_user_id\`, \`provider_id\`)
|
|
74
|
+
`);
|
|
75
|
+
await queryRunner.query(`
|
|
76
|
+
DROP INDEX \`IDX_04264aebc8b6625b1da88e23df\` ON \`auth_client_scopes\`
|
|
77
|
+
`);
|
|
78
|
+
await queryRunner.query(`
|
|
79
|
+
DROP INDEX \`IDX_52f59535945c8cdbd62439bba5\` ON \`auth_client_scopes\`
|
|
80
|
+
`);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
export { SortIndexesAndAccountUniqueness1786631686318 };
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=1786631686318-SortIndexesAndAccountUniqueness.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1786631686318-SortIndexesAndAccountUniqueness.mjs","names":["SortIndexesAndAccountUniqueness1786631686318","name","up","queryRunner","duplicates","query","length","Error","down"],"sources":["../../../../../src/adapters/database/migrations/mysql/1786631686318-SortIndexesAndAccountUniqueness.ts"],"sourcesContent":["import type { MigrationInterface, QueryRunner } from 'typeorm';\n\n/**\n * Client-scope sort indexes (issue #3441) and identity-provider account\n * uniqueness (issue #3442).\n *\n * - Indexes `auth_client_scopes.created_at` and `updated_at`.\n * `clientScopeSchema` was the only registered schema with no `sorts`\n * allow-list, so rapiq fell back to a syntactic name check and handed an\n * arbitrary `?sort=` key to `ORDER BY`. Declaring the allow-list requires\n * every listed key to lead a real entity index; the two timestamp columns\n * were the only ones missing theirs.\n * - Makes `(provider_user_id, provider_id)` unique on\n * `auth_identity_provider_accounts`. \"One external identity belongs to one\n * local user\" was enforced only by a read-then-write in\n * `IdentityProviderAccountManager`: no transaction, no row lock, and\n * nothing behind it in the schema, so two concurrent completions for the\n * same upstream subject could both observe \"not linked\" and both insert.\n * After that the subject resolves to whichever row the database happens to\n * order first. The column order matches the pre-existing non-unique index,\n * so this is an in-place uniqueness flip under the same derived name\n * rather than a rename.\n *\n * MySQL commits DDL implicitly, so `migrationsTransactionMode: 'all'` cannot\n * roll a partial run back. A DROP followed by a CREATE would leave the table\n * with no index of that name if the process died between them, and every\n * later attempt would then fail at the DROP. One ALTER carrying both is\n * atomic, so the uniqueness flip either applies or does not.\n *\n * Pre-existing duplicates abort the boot with an actionable message. They\n * would abort it anyway, since `CREATE UNIQUE INDEX` fails on them; the\n * check only decides whether the operator reads a readable sentence or a\n * hash-named driver error.\n *\n * It runs BEFORE any DDL for the same implicit-commit reason: an abort\n * after the two CREATE INDEX statements leaves them committed while the\n * migration stays unapplied, so the operator's retry — after cleaning the\n * duplicates — would die on `Duplicate key name` and never reach the flip.\n * Nothing here writes before the check, so a refusal leaves the schema\n * exactly as it was.\n *\n * Generated with `migration generate`; derived IDX_<hash> names, generated\n * DDL untouched (the duplicate pre-check and the single-ALTER flip are\n * hand-authored).\n */\nexport class SortIndexesAndAccountUniqueness1786631686318 implements MigrationInterface {\n name = 'SortIndexesAndAccountUniqueness1786631686318';\n\n public async up(queryRunner: QueryRunner): Promise<void> {\n const duplicates = await queryRunner.query(`\n SELECT \\`provider_id\\`, \\`provider_user_id\\`, COUNT(*) AS \\`count\\`\n FROM \\`auth_identity_provider_accounts\\`\n GROUP BY \\`provider_id\\`, \\`provider_user_id\\`\n HAVING COUNT(*) > 1\n `);\n if (duplicates.length > 0) {\n throw new Error(\n `Identity-provider account uniqueness migration aborted: \"auth_identity_provider_accounts\" holds ${duplicates.length} ` +\n 'duplicate (provider_id, provider_user_id) group(s). One external identity must belong to one local user. ' +\n 'Merge or delete the conflicting rows manually before re-running.',\n );\n }\n\n await queryRunner.query(`\n CREATE INDEX \\`IDX_52f59535945c8cdbd62439bba5\\` ON \\`auth_client_scopes\\` (\\`created_at\\`)\n `);\n await queryRunner.query(`\n CREATE INDEX \\`IDX_04264aebc8b6625b1da88e23df\\` ON \\`auth_client_scopes\\` (\\`updated_at\\`)\n `);\n\n await queryRunner.query(`\n ALTER TABLE \\`auth_identity_provider_accounts\\`\n DROP INDEX \\`IDX_ccf3fd36253755bd9a5f43c516\\`,\n ADD UNIQUE INDEX \\`IDX_ccf3fd36253755bd9a5f43c516\\` (\\`provider_user_id\\`, \\`provider_id\\`)\n `);\n }\n\n public async down(queryRunner: QueryRunner): Promise<void> {\n await queryRunner.query(`\n ALTER TABLE \\`auth_identity_provider_accounts\\`\n DROP INDEX \\`IDX_ccf3fd36253755bd9a5f43c516\\`,\n ADD INDEX \\`IDX_ccf3fd36253755bd9a5f43c516\\` (\\`provider_user_id\\`, \\`provider_id\\`)\n `);\n await queryRunner.query(`\n DROP INDEX \\`IDX_04264aebc8b6625b1da88e23df\\` ON \\`auth_client_scopes\\`\n `);\n await queryRunner.query(`\n DROP INDEX \\`IDX_52f59535945c8cdbd62439bba5\\` ON \\`auth_client_scopes\\`\n `);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CA,IAAaA,+CAAb,MAAaA;CACTC,OAAO;CAEP,MAAaC,GAAGC,aAAyC;EACrD,MAAMC,aAAa,MAAMD,YAAYE,MAAM;;;;;SAK1C;EACD,IAAID,WAAWE,SAAS,GACpB,MAAM,IAAIC,MACN,mGAAmGH,WAAWE,OAAO,2KAErH;EAIR,MAAMH,YAAYE,MAAM;;SAEvB;EACD,MAAMF,YAAYE,MAAM;;SAEvB;EAED,MAAMF,YAAYE,MAAM;;;;SAIvB;CACL;CAEA,MAAaG,KAAKL,aAAyC;EACvD,MAAMA,YAAYE,MAAM;;;;SAIvB;EACD,MAAMF,YAAYE,MAAM;;SAEvB;EACD,MAAMF,YAAYE,MAAM;;SAEvB;CACL;AACJ"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* Client-scope sort indexes (issue #3441) and identity-provider account
|
|
4
|
+
* uniqueness (issue #3442).
|
|
5
|
+
*
|
|
6
|
+
* - Indexes `auth_client_scopes.created_at` and `updated_at`.
|
|
7
|
+
* `clientScopeSchema` was the only registered schema with no `sorts`
|
|
8
|
+
* allow-list, so rapiq fell back to a syntactic name check and handed an
|
|
9
|
+
* arbitrary `?sort=` key to `ORDER BY`. Declaring the allow-list requires
|
|
10
|
+
* every listed key to lead a real entity index; the two timestamp columns
|
|
11
|
+
* were the only ones missing theirs.
|
|
12
|
+
* - Makes `(provider_user_id, provider_id)` unique on
|
|
13
|
+
* `auth_identity_provider_accounts`. "One external identity belongs to one
|
|
14
|
+
* local user" was enforced only by a read-then-write in
|
|
15
|
+
* `IdentityProviderAccountManager`: no transaction, no row lock, and
|
|
16
|
+
* nothing behind it in the schema, so two concurrent completions for the
|
|
17
|
+
* same upstream subject could both observe "not linked" and both insert.
|
|
18
|
+
* After that the subject resolves to whichever row the database happens to
|
|
19
|
+
* order first. The column order matches the pre-existing non-unique index,
|
|
20
|
+
* so this is an in-place uniqueness flip under the same derived name
|
|
21
|
+
* rather than a rename.
|
|
22
|
+
*
|
|
23
|
+
* Pre-existing duplicates abort the boot with an actionable message. They
|
|
24
|
+
* would abort it anyway, since `CREATE UNIQUE INDEX` fails on them; the
|
|
25
|
+
* check only decides whether the operator reads a readable sentence or a
|
|
26
|
+
* hash-named driver error.
|
|
27
|
+
*
|
|
28
|
+
* It runs before any DDL, matching the mysql half: postgres would roll the
|
|
29
|
+
* whole migration back on the abort, but keeping one order across both
|
|
30
|
+
* dialects means the refusal never depends on which one is reading it.
|
|
31
|
+
*
|
|
32
|
+
* Generated with `migration generate`; derived IDX_<hash> names, generated
|
|
33
|
+
* DDL untouched (the duplicate pre-check is hand-authored, and `down()`
|
|
34
|
+
* carries the hand-corrected column order — see
|
|
35
|
+
* .agents/references/typeorm.md).
|
|
36
|
+
*/
|
|
37
|
+
export declare class SortIndexesAndAccountUniqueness1786631686318 implements MigrationInterface {
|
|
38
|
+
name: string;
|
|
39
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
40
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=1786631686318-SortIndexesAndAccountUniqueness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1786631686318-SortIndexesAndAccountUniqueness.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/database/migrations/postgres/1786631686318-SortIndexesAndAccountUniqueness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,4CAA6C,YAAW,kBAAkB;IACnF,IAAI,SAAkD;IAEzC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAc7D"}
|
package/dist/adapters/database/migrations/postgres/1786631686318-SortIndexesAndAccountUniqueness.mjs
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/adapters/database/migrations/postgres/1786631686318-SortIndexesAndAccountUniqueness.ts
|
|
5
|
+
/**
|
|
6
|
+
* Client-scope sort indexes (issue #3441) and identity-provider account
|
|
7
|
+
* uniqueness (issue #3442).
|
|
8
|
+
*
|
|
9
|
+
* - Indexes `auth_client_scopes.created_at` and `updated_at`.
|
|
10
|
+
* `clientScopeSchema` was the only registered schema with no `sorts`
|
|
11
|
+
* allow-list, so rapiq fell back to a syntactic name check and handed an
|
|
12
|
+
* arbitrary `?sort=` key to `ORDER BY`. Declaring the allow-list requires
|
|
13
|
+
* every listed key to lead a real entity index; the two timestamp columns
|
|
14
|
+
* were the only ones missing theirs.
|
|
15
|
+
* - Makes `(provider_user_id, provider_id)` unique on
|
|
16
|
+
* `auth_identity_provider_accounts`. "One external identity belongs to one
|
|
17
|
+
* local user" was enforced only by a read-then-write in
|
|
18
|
+
* `IdentityProviderAccountManager`: no transaction, no row lock, and
|
|
19
|
+
* nothing behind it in the schema, so two concurrent completions for the
|
|
20
|
+
* same upstream subject could both observe "not linked" and both insert.
|
|
21
|
+
* After that the subject resolves to whichever row the database happens to
|
|
22
|
+
* order first. The column order matches the pre-existing non-unique index,
|
|
23
|
+
* so this is an in-place uniqueness flip under the same derived name
|
|
24
|
+
* rather than a rename.
|
|
25
|
+
*
|
|
26
|
+
* Pre-existing duplicates abort the boot with an actionable message. They
|
|
27
|
+
* would abort it anyway, since `CREATE UNIQUE INDEX` fails on them; the
|
|
28
|
+
* check only decides whether the operator reads a readable sentence or a
|
|
29
|
+
* hash-named driver error.
|
|
30
|
+
*
|
|
31
|
+
* It runs before any DDL, matching the mysql half: postgres would roll the
|
|
32
|
+
* whole migration back on the abort, but keeping one order across both
|
|
33
|
+
* dialects means the refusal never depends on which one is reading it.
|
|
34
|
+
*
|
|
35
|
+
* Generated with `migration generate`; derived IDX_<hash> names, generated
|
|
36
|
+
* DDL untouched (the duplicate pre-check is hand-authored, and `down()`
|
|
37
|
+
* carries the hand-corrected column order — see
|
|
38
|
+
* .agents/references/typeorm.md).
|
|
39
|
+
*/ var SortIndexesAndAccountUniqueness1786631686318 = class {
|
|
40
|
+
name = "SortIndexesAndAccountUniqueness1786631686318";
|
|
41
|
+
async up(queryRunner) {
|
|
42
|
+
const duplicates = await queryRunner.query(`
|
|
43
|
+
SELECT "provider_id", "provider_user_id", COUNT(*) AS "count"
|
|
44
|
+
FROM "auth_identity_provider_accounts"
|
|
45
|
+
GROUP BY "provider_id", "provider_user_id"
|
|
46
|
+
HAVING COUNT(*) > 1
|
|
47
|
+
`);
|
|
48
|
+
if (duplicates.length > 0) throw new Error(`Identity-provider account uniqueness migration aborted: "auth_identity_provider_accounts" holds ${duplicates.length} duplicate (provider_id, provider_user_id) group(s). One external identity must belong to one local user. Merge or delete the conflicting rows manually before re-running.`);
|
|
49
|
+
await queryRunner.query(`
|
|
50
|
+
CREATE INDEX "IDX_52f59535945c8cdbd62439bba5" ON "auth_client_scopes" ("created_at")
|
|
51
|
+
`);
|
|
52
|
+
await queryRunner.query(`
|
|
53
|
+
CREATE INDEX "IDX_04264aebc8b6625b1da88e23df" ON "auth_client_scopes" ("updated_at")
|
|
54
|
+
`);
|
|
55
|
+
await queryRunner.query(`
|
|
56
|
+
DROP INDEX "public"."IDX_ccf3fd36253755bd9a5f43c516"
|
|
57
|
+
`);
|
|
58
|
+
await queryRunner.query(`
|
|
59
|
+
CREATE UNIQUE INDEX "IDX_ccf3fd36253755bd9a5f43c516" ON "auth_identity_provider_accounts" ("provider_user_id", "provider_id")
|
|
60
|
+
`);
|
|
61
|
+
}
|
|
62
|
+
async down(queryRunner) {
|
|
63
|
+
await queryRunner.query(`
|
|
64
|
+
DROP INDEX "public"."IDX_ccf3fd36253755bd9a5f43c516"
|
|
65
|
+
`);
|
|
66
|
+
await queryRunner.query(`
|
|
67
|
+
CREATE INDEX "IDX_ccf3fd36253755bd9a5f43c516" ON "auth_identity_provider_accounts" ("provider_user_id", "provider_id")
|
|
68
|
+
`);
|
|
69
|
+
await queryRunner.query(`
|
|
70
|
+
DROP INDEX "public"."IDX_04264aebc8b6625b1da88e23df"
|
|
71
|
+
`);
|
|
72
|
+
await queryRunner.query(`
|
|
73
|
+
DROP INDEX "public"."IDX_52f59535945c8cdbd62439bba5"
|
|
74
|
+
`);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
export { SortIndexesAndAccountUniqueness1786631686318 };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=1786631686318-SortIndexesAndAccountUniqueness.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1786631686318-SortIndexesAndAccountUniqueness.mjs","names":["SortIndexesAndAccountUniqueness1786631686318","name","up","queryRunner","duplicates","query","length","Error","down"],"sources":["../../../../../src/adapters/database/migrations/postgres/1786631686318-SortIndexesAndAccountUniqueness.ts"],"sourcesContent":["import type { MigrationInterface, QueryRunner } from 'typeorm';\n\n/**\n * Client-scope sort indexes (issue #3441) and identity-provider account\n * uniqueness (issue #3442).\n *\n * - Indexes `auth_client_scopes.created_at` and `updated_at`.\n * `clientScopeSchema` was the only registered schema with no `sorts`\n * allow-list, so rapiq fell back to a syntactic name check and handed an\n * arbitrary `?sort=` key to `ORDER BY`. Declaring the allow-list requires\n * every listed key to lead a real entity index; the two timestamp columns\n * were the only ones missing theirs.\n * - Makes `(provider_user_id, provider_id)` unique on\n * `auth_identity_provider_accounts`. \"One external identity belongs to one\n * local user\" was enforced only by a read-then-write in\n * `IdentityProviderAccountManager`: no transaction, no row lock, and\n * nothing behind it in the schema, so two concurrent completions for the\n * same upstream subject could both observe \"not linked\" and both insert.\n * After that the subject resolves to whichever row the database happens to\n * order first. The column order matches the pre-existing non-unique index,\n * so this is an in-place uniqueness flip under the same derived name\n * rather than a rename.\n *\n * Pre-existing duplicates abort the boot with an actionable message. They\n * would abort it anyway, since `CREATE UNIQUE INDEX` fails on them; the\n * check only decides whether the operator reads a readable sentence or a\n * hash-named driver error.\n *\n * It runs before any DDL, matching the mysql half: postgres would roll the\n * whole migration back on the abort, but keeping one order across both\n * dialects means the refusal never depends on which one is reading it.\n *\n * Generated with `migration generate`; derived IDX_<hash> names, generated\n * DDL untouched (the duplicate pre-check is hand-authored, and `down()`\n * carries the hand-corrected column order — see\n * .agents/references/typeorm.md).\n */\nexport class SortIndexesAndAccountUniqueness1786631686318 implements MigrationInterface {\n name = 'SortIndexesAndAccountUniqueness1786631686318';\n\n public async up(queryRunner: QueryRunner): Promise<void> {\n const duplicates = await queryRunner.query(`\n SELECT \"provider_id\", \"provider_user_id\", COUNT(*) AS \"count\"\n FROM \"auth_identity_provider_accounts\"\n GROUP BY \"provider_id\", \"provider_user_id\"\n HAVING COUNT(*) > 1\n `);\n if (duplicates.length > 0) {\n throw new Error(\n `Identity-provider account uniqueness migration aborted: \"auth_identity_provider_accounts\" holds ${duplicates.length} ` +\n 'duplicate (provider_id, provider_user_id) group(s). One external identity must belong to one local user. ' +\n 'Merge or delete the conflicting rows manually before re-running.',\n );\n }\n\n await queryRunner.query(`\n CREATE INDEX \"IDX_52f59535945c8cdbd62439bba5\" ON \"auth_client_scopes\" (\"created_at\")\n `);\n await queryRunner.query(`\n CREATE INDEX \"IDX_04264aebc8b6625b1da88e23df\" ON \"auth_client_scopes\" (\"updated_at\")\n `);\n\n await queryRunner.query(`\n DROP INDEX \"public\".\"IDX_ccf3fd36253755bd9a5f43c516\"\n `);\n await queryRunner.query(`\n CREATE UNIQUE INDEX \"IDX_ccf3fd36253755bd9a5f43c516\" ON \"auth_identity_provider_accounts\" (\"provider_user_id\", \"provider_id\")\n `);\n }\n\n public async down(queryRunner: QueryRunner): Promise<void> {\n await queryRunner.query(`\n DROP INDEX \"public\".\"IDX_ccf3fd36253755bd9a5f43c516\"\n `);\n await queryRunner.query(`\n CREATE INDEX \"IDX_ccf3fd36253755bd9a5f43c516\" ON \"auth_identity_provider_accounts\" (\"provider_user_id\", \"provider_id\")\n `);\n await queryRunner.query(`\n DROP INDEX \"public\".\"IDX_04264aebc8b6625b1da88e23df\"\n `);\n await queryRunner.query(`\n DROP INDEX \"public\".\"IDX_52f59535945c8cdbd62439bba5\"\n `);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCA,IAAaA,+CAAb,MAAaA;CACTC,OAAO;CAEP,MAAaC,GAAGC,aAAyC;EACrD,MAAMC,aAAa,MAAMD,YAAYE,MAAM;;;;;SAK1C;EACD,IAAID,WAAWE,SAAS,GACpB,MAAM,IAAIC,MACN,mGAAmGH,WAAWE,OAAO,2KAErH;EAIR,MAAMH,YAAYE,MAAM;;SAEvB;EACD,MAAMF,YAAYE,MAAM;;SAEvB;EAED,MAAMF,YAAYE,MAAM;;SAEvB;EACD,MAAMF,YAAYE,MAAM;;SAEvB;CACL;CAEA,MAAaG,KAAKL,aAAyC;EACvD,MAAMA,YAAYE,MAAM;;SAEvB;EACD,MAAMF,YAAYE,MAAM;;SAEvB;EACD,MAAMF,YAAYE,MAAM;;SAEvB;EACD,MAAMF,YAAYE,MAAM;;SAEvB;CACL;AACJ"}
|
|
@@ -2,8 +2,8 @@ import "node:path";
|
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
4
|
import { OAuth2RequestError } from "@authup/specs";
|
|
5
|
-
import { readRequestBody } from "@routup/basic/body";
|
|
6
5
|
import { AuthorizationHeaderType, parseAuthorizationHeader } from "hapic";
|
|
6
|
+
import { readRequestBody } from "@routup/basic/body";
|
|
7
7
|
//#region src/adapters/http/adapters/oauth2/grant-types/utils/credentials.ts
|
|
8
8
|
/**
|
|
9
9
|
* Extract client credentials from an OAuth2 token endpoint request.
|
|
@@ -2,9 +2,9 @@ import "node:path";
|
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
4
|
import { OAuth2TokenGrant } from "@authup/specs";
|
|
5
|
+
import { AuthorizationHeaderType, parseAuthorizationHeader } from "hapic";
|
|
5
6
|
import { readRequestBody } from "@routup/basic/body";
|
|
6
7
|
import { useRequestQuery } from "@routup/basic/query";
|
|
7
|
-
import { AuthorizationHeaderType, parseAuthorizationHeader } from "hapic";
|
|
8
8
|
//#region src/adapters/http/adapters/oauth2/grant-types/utils/guess.ts
|
|
9
9
|
async function guessOauth2GrantTypeByRequest(event) {
|
|
10
10
|
const body = await readRequestBody(event);
|
|
@@ -4,6 +4,8 @@ import.meta.url;
|
|
|
4
4
|
import { RECORD_QUERY_PARAMETERS, describeQuerySchema } from "../../../../../core/query/describe.mjs";
|
|
5
5
|
import { clientSchema } from "../../../../../core/entities/client/schema.mjs";
|
|
6
6
|
import { OAuth2ScopeAttributesResolver } from "../../../../../core/oauth2/scope/resolver.mjs";
|
|
7
|
+
import { isSelfToken } from "../../../../../utils/self-id.mjs";
|
|
8
|
+
import "../../../../../utils/index.mjs";
|
|
7
9
|
import "../../../../../core/index.mjs";
|
|
8
10
|
import { useRequestIdentity } from "../../../request/helpers/identity.mjs";
|
|
9
11
|
import { buildActorContext } from "../../../request/helpers/actor.mjs";
|
|
@@ -11,8 +13,6 @@ import { applyRouteRealmIDToBody, getRequestRealmID } from "../../../request/hel
|
|
|
11
13
|
import { useRequestScopes } from "../../../request/helpers/scopes.mjs";
|
|
12
14
|
import "../../../request/index.mjs";
|
|
13
15
|
import { ForceLoggedInMiddleware } from "../../../middleware/built-in/loggedin/module.mjs";
|
|
14
|
-
import { isSelfToken } from "../../../../../utils/self-id.mjs";
|
|
15
|
-
import "../../../../../utils/index.mjs";
|
|
16
16
|
import "../../../middleware/index.mjs";
|
|
17
17
|
import { EntityNotFoundError } from "@authup/errors";
|
|
18
18
|
import { OAuth2SubKind } from "@authup/specs";
|
|
@@ -2,20 +2,18 @@ import type { IAppEvent } from 'routup';
|
|
|
2
2
|
import type { IdentityProvider, IdentityProviderAccount } from '@authup/core-kit';
|
|
3
3
|
import type { Logger } from '@authup/server-kit';
|
|
4
4
|
import type { EntityCollectionResponse, EntityRecordResponse, IdentityProviderCreatePayload, IdentityProviderLinkConfirmPayload, IdentityProviderLinkRequestResponse, IdentityProviderSavePayload, IdentityProviderUpdatePayload } from '@authup/core-http-kit';
|
|
5
|
-
import type { IEventService, IIdentityProviderAccountLinkStore, IIdentityProviderAccountManager, IIdentityProviderRepository,
|
|
5
|
+
import type { IEventService, IIdentityProviderAccountLinkStore, IIdentityProviderAccountManager, IIdentityProviderRepository, IOAuth2AuthorizationCodeRequestVerifier, IOAuth2AuthorizationStateManager, IOAuth2FederatedLoginService } from '../../../../../core/index.ts';
|
|
6
6
|
import { OAuth2AuthorizationCodeRequestValidator } from '../../../../../core/index.ts';
|
|
7
7
|
import type { IdentityProviderControllerContext, IdentityProviderControllerOptions } from './types.ts';
|
|
8
8
|
export declare class IdentityProviderController {
|
|
9
9
|
protected options: IdentityProviderControllerOptions;
|
|
10
10
|
protected repository: IIdentityProviderRepository;
|
|
11
|
-
protected realmRepository: IRealmRepository;
|
|
12
11
|
protected accountManager: IIdentityProviderAccountManager;
|
|
13
12
|
protected linkStore: IIdentityProviderAccountLinkStore;
|
|
14
13
|
protected codeRequestVerifier: IOAuth2AuthorizationCodeRequestVerifier;
|
|
15
14
|
protected codeRequestValidator: OAuth2AuthorizationCodeRequestValidator;
|
|
16
15
|
protected stateManager: IOAuth2AuthorizationStateManager;
|
|
17
|
-
protected
|
|
18
|
-
protected accessPolicyEvaluator?: IOAuth2AccessPolicyEvaluator;
|
|
16
|
+
protected loginService: IOAuth2FederatedLoginService;
|
|
19
17
|
protected eventService?: IEventService;
|
|
20
18
|
protected logger?: Logger;
|
|
21
19
|
constructor(ctx: IdentityProviderControllerContext);
|
|
@@ -27,7 +25,7 @@ export declare class IdentityProviderController {
|
|
|
27
25
|
addProvider(user: IdentityProviderCreatePayload, event: IAppEvent): Promise<EntityRecordResponse<IdentityProvider>>;
|
|
28
26
|
authorizeOut(_id: string, event: IAppEvent): Promise<Response>;
|
|
29
27
|
linkRequest(_id: string, event: IAppEvent): Promise<IdentityProviderLinkRequestResponse>;
|
|
30
|
-
authorizeIn(_id: string, event: IAppEvent): Promise<Response>;
|
|
28
|
+
authorizeIn(_id: string, event: IAppEvent): Promise<string | Response>;
|
|
31
29
|
private write;
|
|
32
30
|
/**
|
|
33
31
|
* Callback half of the account-linking round-trip (plan 091): the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/entities/identity-provider/module.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAMxC,OAAO,KAAK,EACR,gBAAgB,EAChB,uBAAuB,EAI1B,MAAM,kBAAkB,CAAC;AAc1B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,OAAO,KAAK,EACR,wBAAwB,EACxB,oBAAoB,EACpB,6BAA6B,EAC7B,kCAAkC,EAClC,mCAAmC,EACnC,2BAA2B,EAC3B,6BAA6B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACR,aAAa,EACb,iCAAiC,EACjC,+BAA+B,EAC/B,2BAA2B,EAC3B,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/adapters/http/controllers/entities/identity-provider/module.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAMxC,OAAO,KAAK,EACR,gBAAgB,EAChB,uBAAuB,EAI1B,MAAM,kBAAkB,CAAC;AAc1B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD,OAAO,KAAK,EACR,wBAAwB,EACxB,oBAAoB,EACpB,6BAA6B,EAC7B,kCAAkC,EAClC,mCAAmC,EACnC,2BAA2B,EAC3B,6BAA6B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACR,aAAa,EACb,iCAAiC,EACjC,+BAA+B,EAC/B,2BAA2B,EAC3B,uCAAuC,EACvC,gCAAgC,EAChC,4BAA4B,EAI/B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,uCAAuC,EAM1C,MAAM,8BAA8B,CAAC;AAetC,OAAO,KAAK,EAAE,iCAAiC,EAAE,iCAAiC,EAAE,MAAM,YAAY,CAAC;AAEvG,qBAEa,0BAA0B;IACnC,SAAS,CAAC,OAAO,EAAE,iCAAiC,CAAC;IAErD,SAAS,CAAC,UAAU,EAAE,2BAA2B,CAAC;IAElD,SAAS,CAAC,cAAc,EAAE,+BAA+B,CAAC;IAE1D,SAAS,CAAC,SAAS,EAAE,iCAAiC,CAAC;IAEvD,SAAS,CAAC,mBAAmB,EAAG,uCAAuC,CAAC;IAExE,SAAS,CAAC,oBAAoB,EAAG,uCAAuC,CAAC;IAEzE,SAAS,CAAC,YAAY,EAAG,gCAAgC,CAAC;IAE1D,SAAS,CAAC,YAAY,EAAG,4BAA4B,CAAC;IAEtD,SAAS,CAAC,YAAY,CAAC,EAAG,aAAa,CAAC;IAExC,SAAS,CAAC,MAAM,CAAC,EAAG,MAAM,CAAC;gBAIf,GAAG,EAAE,iCAAiC;IAgB5C,YAAY,CACF,KAAK,EAAE,SAAS,GAC7B,OAAO,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;IAuChD,WAAW,CACA,EAAE,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,GAC7B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IA0B5C,YAAY,CACD,EAAE,EAAE,MAAM,EACd,IAAI,EAAE,6BAA6B,EAChC,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IAK7C,GAAG,CACQ,EAAE,EAAE,MAAM,EACd,IAAI,EAAE,2BAA2B,EAC9B,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IAK7C,YAAY,CACD,EAAE,EAAE,MAAM,EACX,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IA6B7C,WAAW,CACJ,IAAI,EAAE,6BAA6B,EAChC,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IAO7C,YAAY,CACD,GAAG,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS;IAoD1B,WAAW,CACA,GAAG,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,mCAAmC,CAAC;IA6B1C,WAAW,CACA,GAAG,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS;YA4GlB,KAAK;IA+FnB;;;;;OAKG;YACW,YAAY;IAyE1B;;;OAGG;IAEG,WAAW,CACA,GAAG,EAAE,MAAM,EACf,KAAK,EAAE,kCAAkC,EACtC,KAAK,EAAE,SAAS,GAC5B,OAAO,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IA2E1D,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,uBAAuB;YAmBjB,OAAO;IAYrB,OAAO,CAAC,0BAA0B;YAepB,sBAAsB;YAWtB,wBAAwB;CAWzC"}
|