@webda/auth 4.0.0-beta.4 → 4.0.0-beta.5
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.
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Service } from "@webda/core";
|
|
2
|
+
import type { TestApplication } from "@webda/core/lib/test/objects.js";
|
|
3
|
+
/**
|
|
4
|
+
* Minimal AuthProvider service: specs call `complete()` on its behalf
|
|
5
|
+
*/
|
|
6
|
+
export declare class StubProvider extends Service {
|
|
7
|
+
readonly providerName: string;
|
|
8
|
+
/**
|
|
9
|
+
* @returns public info
|
|
10
|
+
*/
|
|
11
|
+
getPublicInfo(): {
|
|
12
|
+
name: string;
|
|
13
|
+
type: "oauth";
|
|
14
|
+
startUrl: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @param name - provider name
|
|
19
|
+
* @returns a StubProvider class whose provider is `name`
|
|
20
|
+
*/
|
|
21
|
+
export declare function stubProvider(name: string): typeof StubProvider;
|
|
22
|
+
/**
|
|
23
|
+
* Register stub providers in a test application: add `<name>: { type: "WebdaTest/Stub_<name>" }` to the services
|
|
24
|
+
* @param app - test application
|
|
25
|
+
* @param names - provider names
|
|
26
|
+
*/
|
|
27
|
+
export declare function addStubProviders(app: TestApplication, ...names: string[]): void;
|
|
28
|
+
/**
|
|
29
|
+
* @param names - provider names
|
|
30
|
+
* @returns the services configuration of the stub providers
|
|
31
|
+
*/
|
|
32
|
+
export declare function stubProvidersConfig(...names: string[]): Record<string, {
|
|
33
|
+
type: string;
|
|
34
|
+
}>;
|
|
35
|
+
//# sourceMappingURL=stubprovider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stubprovider.d.ts","sourceRoot":"","sources":["../../src/test/stubprovider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;GAEG;AACH,qBAAa,YAAa,SAAQ,OAAO;IACvC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAM;IAEnC;;OAEG;IACH,aAAa,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAEjE;CACF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,YAAY,CAI9D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAI/E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAExF"}
|
package/lib/test/stubprovider.js
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { Service } from "@webda/core";
|
|
2
|
+
/**
|
|
3
|
+
* Minimal AuthProvider service: specs call `complete()` on its behalf
|
|
4
|
+
*/
|
|
5
|
+
export class StubProvider extends Service {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.providerName = "";
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @returns public info
|
|
12
|
+
*/
|
|
13
|
+
getPublicInfo() {
|
|
14
|
+
return { name: this.providerName, type: "oauth", startUrl: `/auth/${this.providerName}` };
|
|
15
|
+
}
|
|
16
|
+
}
|
|
2
17
|
/**
|
|
3
18
|
* @param name - provider name
|
|
4
|
-
* @returns a
|
|
19
|
+
* @returns a StubProvider class whose provider is `name`
|
|
5
20
|
*/
|
|
6
21
|
export function stubProvider(name) {
|
|
7
|
-
return class
|
|
22
|
+
return class extends StubProvider {
|
|
8
23
|
constructor() {
|
|
9
24
|
super(...arguments);
|
|
10
25
|
this.providerName = name;
|
|
11
26
|
}
|
|
12
|
-
/**
|
|
13
|
-
* @returns public info
|
|
14
|
-
*/
|
|
15
|
-
getPublicInfo() {
|
|
16
|
-
return { name, type: "oauth", startUrl: `/auth/${name}` };
|
|
17
|
-
}
|
|
18
27
|
};
|
|
19
28
|
}
|
|
20
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stubprovider.js","sourceRoot":"","sources":["../../src/test/stubprovider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC
|
|
1
|
+
{"version":3,"file":"stubprovider.js","sourceRoot":"","sources":["../../src/test/stubprovider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,OAAO;IAAzC;;QACW,iBAAY,GAAW,EAAE,CAAC;IAQrC,CAAC;IANC;;OAEG;IACH,aAAa;QACX,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;IAC5F,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,KAAM,SAAQ,YAAY;QAA1B;;YACI,iBAAY,GAAG,IAAI,CAAC;QAC/B,CAAC;KAAA,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAoB,EAAE,GAAG,KAAe;IACvE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,GAAG,CAAC,QAAQ,CAAC,kBAAkB,IAAI,EAAE,EAAE,YAAY,CAAC,IAAI,CAAQ,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAG,KAAe;IACpD,OAAO,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,MAAM,EAAE,EAAE,IAAI,EAAE,kBAAkB,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACpG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webda/auth",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.5",
|
|
4
4
|
"description": "Authentication service and providers for Webda",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -8,14 +8,18 @@
|
|
|
8
8
|
"webda"
|
|
9
9
|
],
|
|
10
10
|
"author": "Remi Cattiau <remi@cattiau.com>",
|
|
11
|
-
"repository":
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/loopingz/webda.io.git",
|
|
14
|
+
"directory": "packages/auth"
|
|
15
|
+
},
|
|
12
16
|
"main": "lib/index.js",
|
|
13
17
|
"typings": "lib/index.d.ts",
|
|
14
18
|
"dependencies": {
|
|
15
|
-
"@webda/core": "4.0.0-beta.
|
|
16
|
-
"@webda/utils": "4.0.0-beta.
|
|
17
|
-
"@webda/models": "4.0.0-beta.
|
|
18
|
-
"@webda/workout": "4.0.0-beta.
|
|
19
|
+
"@webda/core": "4.0.0-beta.5",
|
|
20
|
+
"@webda/utils": "4.0.0-beta.5",
|
|
21
|
+
"@webda/models": "4.0.0-beta.5",
|
|
22
|
+
"@webda/workout": "4.0.0-beta.5"
|
|
19
23
|
},
|
|
20
24
|
"files": [
|
|
21
25
|
"lib",
|
|
@@ -38,10 +42,10 @@
|
|
|
38
42
|
"typescript": "7.1.0-dev.20260929.1",
|
|
39
43
|
"vite": "^6.0.0",
|
|
40
44
|
"vitest": "^4.1.2",
|
|
41
|
-
"@webda/
|
|
42
|
-
"@webda/
|
|
43
|
-
"@webda/
|
|
44
|
-
"@webda/
|
|
45
|
+
"@webda/fs": "4.0.0-beta.5",
|
|
46
|
+
"@webda/compiler": "^4.0.0-beta.5",
|
|
47
|
+
"@webda/test": "4.0.0-beta.5",
|
|
48
|
+
"@webda/content-mapper": "^4.0.0-beta.5"
|
|
45
49
|
},
|
|
46
50
|
"type": "module",
|
|
47
51
|
"engines": {
|
package/webda.module.json
CHANGED
|
@@ -234,10 +234,6 @@
|
|
|
234
234
|
"additionalProperties": false,
|
|
235
235
|
"description": "Represent a file to store",
|
|
236
236
|
"properties": {
|
|
237
|
-
"challenge": {
|
|
238
|
-
"description": "Will be computed by the service\n\nhash of the content prefixed by 'WEBDA'",
|
|
239
|
-
"type": "string"
|
|
240
|
-
},
|
|
241
237
|
"hash": {
|
|
242
238
|
"description": "Will be computed by the service\n\nhash of the content",
|
|
243
239
|
"type": "string"
|