@tryghost/adapter-base-sso 0.1.2 → 0.1.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.
- package/CHANGELOG.md +16 -0
- package/README.md +3 -0
- package/build/base.d.ts +6 -1
- package/build/base.d.ts.map +1 -1
- package/build/base.js +6 -2
- package/build/base.js.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @tryghost/adapter-base-sso
|
|
2
2
|
|
|
3
|
+
## 0.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated TryGhost/framework dependencies to their latest versions.
|
|
8
|
+
|
|
9
|
+
- Updated TryGhost/framework dependencies to their latest versions.
|
|
10
|
+
|
|
11
|
+
- Exposed optional user status so SSO adapters can reject inactive owners before first-run setup.
|
|
12
|
+
|
|
13
|
+
## 0.1.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Bumped framework dependencies
|
|
18
|
+
|
|
3
19
|
## 0.1.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -26,6 +26,9 @@ Extend `SSOBase` and implement every method listed in `requiredFns`:
|
|
|
26
26
|
Ghost injects a user repository after constructing the adapter, exposed through
|
|
27
27
|
the protected `getUserByEmail(email)` and `getOwnerUser()` helpers — use these
|
|
28
28
|
to resolve Ghost users without reaching into Ghost's model layer directly.
|
|
29
|
+
Ghost supplies `id`, `email`, and `status`. Adapters can require
|
|
30
|
+
`status === 'active'` before granting a session, including when the owner is still the inactive
|
|
31
|
+
placeholder used by first-run setup. Older Ghost versions omit `status`.
|
|
29
32
|
|
|
30
33
|
```js
|
|
31
34
|
const {SSOBase} = require('@tryghost/adapter-base-sso');
|
package/build/base.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Request } from 'express';
|
|
|
2
2
|
export interface User {
|
|
3
3
|
id: string;
|
|
4
4
|
email: string;
|
|
5
|
+
status?: string;
|
|
5
6
|
}
|
|
6
7
|
/**
|
|
7
8
|
* A small set of user lookups that Ghost injects into the SSO adapter, so that
|
|
@@ -25,7 +26,11 @@ export interface SSOAdapter<Token, Lookup> {
|
|
|
25
26
|
}
|
|
26
27
|
export declare abstract class SSOBase<Token, Lookup> implements SSOAdapter<Token, Lookup> {
|
|
27
28
|
#private;
|
|
28
|
-
readonly requiredFns: readonly [
|
|
29
|
+
readonly requiredFns: readonly [
|
|
30
|
+
'getRequestCredentials',
|
|
31
|
+
'getIdentityFromCredentials',
|
|
32
|
+
'getUserForIdentity'
|
|
33
|
+
];
|
|
29
34
|
constructor();
|
|
30
35
|
/**
|
|
31
36
|
* Inject the user repository. Ghost core calls this after constructing the
|
package/build/base.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGvC,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC7B,8EAA8E;IAC9E,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAChD,6DAA6D;IAC7D,QAAQ,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,UAAU,CAAC,KAAK,EAAE,MAAM;IACvC,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IAC/D,0BAA0B,CAAC,WAAW,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACvE,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;CAC5D;AAED,8BAAsB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAE,YAAW,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC;;IAC/E,SAAiB,WAAW,EAAE,SAAS;QACrC,uBAAuB;QACvB,4BAA4B;QAC5B,oBAAoB;KACrB,CAAC;IAIF,cASC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI,CAEtD;IAYD;;;OAGG;IACH,UAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAElE;IAED;;;OAGG;IACH,UAAgB,YAAY,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAEnD;IAED,QAAQ,CAAC,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IACxE,QAAQ,CAAC,0BAA0B,CAAC,WAAW,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAChF,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;CACrE"}
|
package/build/base.js
CHANGED
|
@@ -3,7 +3,11 @@ export class SSOBase {
|
|
|
3
3
|
#userRepository = null;
|
|
4
4
|
constructor() {
|
|
5
5
|
Object.defineProperty(this, 'requiredFns', {
|
|
6
|
-
value: Object.freeze([
|
|
6
|
+
value: Object.freeze([
|
|
7
|
+
'getRequestCredentials',
|
|
8
|
+
'getIdentityFromCredentials',
|
|
9
|
+
'getUserForIdentity',
|
|
10
|
+
]),
|
|
7
11
|
writable: false,
|
|
8
12
|
});
|
|
9
13
|
}
|
|
@@ -18,7 +22,7 @@ export class SSOBase {
|
|
|
18
22
|
get #users() {
|
|
19
23
|
if (!this.#userRepository) {
|
|
20
24
|
throw new errors.IncorrectUsageError({
|
|
21
|
-
message: 'SSO adapter has no user repository configured. Ghost must call setUserRepository() before the adapter is used.'
|
|
25
|
+
message: 'SSO adapter has no user repository configured. Ghost must call setUserRepository() before the adapter is used.',
|
|
22
26
|
});
|
|
23
27
|
}
|
|
24
28
|
return this.#userRepository;
|
package/build/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,kBAAkB,CAAC;AA8BtC,MAAM,OAAgB,OAAO;IAO3B,eAAe,GAA0B,IAAI,CAAC;IAE9C;QACE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE;YACzC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;gBACnB,uBAAuB;gBACvB,4BAA4B;gBAC5B,oBAAoB;aACrB,CAAC;YACF,QAAQ,EAAE,KAAK;SAChB,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,cAA8B;QAC9C,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CAAC;IAED,IAAI,MAAM;QACR,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,MAAM,IAAI,MAAM,CAAC,mBAAmB,CAAC;gBACnC,OAAO,EACL,gHAAgH;aACnH,CAAC,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,cAAc,CAAC,KAAa;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,YAAY;QAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC;CAKF"}
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/adapter-base-sso",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "The adapter-base-sso package for Ghost.",
|
|
5
|
-
"
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Ghost Foundation",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "git+https://github.com/TryGhost/Ghost.git",
|
|
9
10
|
"directory": "packages/adapters/sso-base"
|
|
10
11
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
12
|
+
"files": [
|
|
13
|
+
"build"
|
|
14
|
+
],
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "build/index.js",
|
|
17
|
+
"types": "build/index.d.ts",
|
|
13
18
|
"exports": {
|
|
14
19
|
".": {
|
|
15
20
|
"types": "./build/index.d.ts",
|
|
16
21
|
"default": "./build/index.js"
|
|
17
22
|
}
|
|
18
23
|
},
|
|
19
|
-
"main": "build/index.js",
|
|
20
|
-
"types": "build/index.d.ts",
|
|
21
|
-
"files": [
|
|
22
|
-
"build"
|
|
23
|
-
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@tryghost/errors": "3.
|
|
25
|
+
"@tryghost/errors": "3.4.1"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsc",
|