@flink-app/generic-auth-plugin 0.5.0 → 0.5.2

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.
@@ -1,4 +1,4 @@
1
- // Generated Sat Mar 25 2023 15:16:41 GMT+0100 (Central European Standard Time)
1
+ // Generated Mon Apr 24 2023 14:44:53 GMT+0200 (Central European Summer Time)
2
2
  import { autoRegisteredHandlers, HttpMethod } from "@flink-app/flink";
3
3
  import * as UserCreate_0 from "../src/handlers/UserCreate";
4
4
  import * as UserLogin_0 from "../src/handlers/UserLogin";
@@ -1,4 +1,4 @@
1
- // Generated Sat Mar 25 2023 15:16:41 GMT+0100 (Central European Standard Time)
1
+ // Generated Mon Apr 24 2023 14:44:54 GMT+0200 (Central European Summer Time)
2
2
  import { autoRegisteredJobs } from "@flink-app/flink";
3
3
  export const jobs = [];
4
4
  autoRegisteredJobs.push(...jobs);
@@ -1,4 +1,4 @@
1
- // Generated Sat Mar 25 2023 15:16:41 GMT+0100 (Central European Standard Time)
1
+ // Generated Mon Apr 24 2023 14:44:53 GMT+0200 (Central European Summer Time)
2
2
  import { autoRegisteredRepos } from "@flink-app/flink";
3
3
  export const repos = [];
4
4
  autoRegisteredRepos.push(...repos);
@@ -30,7 +30,7 @@ import { PutManagementUserRolesByUseridRes } from "../../src/schemas/Management/
30
30
  import { PutManagementUserUsernameByUseridReq } from "../../src/schemas/Management/PutUserUsernameByUseridReq";
31
31
  import { PutManagementUserUsernameByUseridRes } from "../../src/schemas/Management/PutUserUsernameByUseridRes";
32
32
 
33
- // Generated Sat Mar 25 2023 15:16:42 GMT+0100 (Central European Standard Time)
33
+ // Generated Mon Apr 24 2023 14:44:56 GMT+0200 (Central European Summer Time)
34
34
  export interface UserCreate_7_ReqSchema extends UserCreateReq {}
35
35
 
36
36
  export interface UserCreate_7_ResSchema extends UserCreateRes {}
package/.flink/start.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Generated Sat Mar 25 2023 15:16:41 GMT+0100 (Central European Standard Time)
1
+ // Generated Mon Apr 24 2023 14:44:54 GMT+0200 (Central European Summer Time)
2
2
  import "./generatedHandlers";
3
3
  import "./generatedRepos";
4
4
  import "./generatedJobs";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handlers = void 0;
4
- // Generated Sat Mar 25 2023 15:16:41 GMT+0100 (Central European Standard Time)
4
+ // Generated Mon Apr 24 2023 14:44:53 GMT+0200 (Central European Summer Time)
5
5
  var flink_1 = require("@flink-app/flink");
6
6
  exports.handlers = [];
7
7
  flink_1.autoRegisteredHandlers.push.apply(flink_1.autoRegisteredHandlers, exports.handlers);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.jobs = void 0;
4
- // Generated Sat Mar 25 2023 15:16:41 GMT+0100 (Central European Standard Time)
4
+ // Generated Mon Apr 24 2023 14:44:54 GMT+0200 (Central European Summer Time)
5
5
  var flink_1 = require("@flink-app/flink");
6
6
  exports.jobs = [];
7
7
  flink_1.autoRegisteredJobs.push.apply(flink_1.autoRegisteredJobs, exports.jobs);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.repos = void 0;
4
- // Generated Sat Mar 25 2023 15:16:41 GMT+0100 (Central European Standard Time)
4
+ // Generated Mon Apr 24 2023 14:44:53 GMT+0200 (Central European Summer Time)
5
5
  var flink_1 = require("@flink-app/flink");
6
6
  exports.repos = [];
7
7
  flink_1.autoRegisteredRepos.push.apply(flink_1.autoRegisteredRepos, exports.repos);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // Generated Sat Mar 25 2023 15:16:41 GMT+0100 (Central European Standard Time)
3
+ // Generated Mon Apr 24 2023 14:44:54 GMT+0200 (Central European Summer Time)
4
4
  require("./generatedHandlers");
5
5
  require("./generatedRepos");
6
6
  require("./generatedJobs");
@@ -9,6 +9,7 @@ export interface GenericAuthPluginOptions {
9
9
  enableUserCreation?: boolean;
10
10
  enableProfileUpdate?: boolean;
11
11
  enablePasswordUpdate?: boolean;
12
+ enableUserLogin?: boolean;
12
13
  baseUrl?: string;
13
14
  pluginId?: string;
14
15
  createPasswordHashAndSaltMethod?: {
package/dist/src/init.js CHANGED
@@ -41,15 +41,19 @@ function init(app, options) {
41
41
  options.enableProfileUpdate = true;
42
42
  if (options.enablePasswordUpdate == null)
43
43
  options.enablePasswordUpdate = true;
44
+ if (options.enableUserLogin == null)
45
+ options.enableUserLogin = true;
44
46
  if (options.baseUrl == null)
45
47
  options.baseUrl = "/user";
46
48
  if (options.enableRoutes) {
47
- app.addHandler(userLoginHandler, {
48
- method: flink_1.HttpMethod.post,
49
- path: options.baseUrl + "/login",
50
- docs: "Authenticates a user",
51
- origin: options.pluginId,
52
- });
49
+ if (options.enableUserLogin) {
50
+ app.addHandler(userLoginHandler, {
51
+ method: flink_1.HttpMethod.post,
52
+ path: options.baseUrl + "/login",
53
+ docs: "Authenticates a user",
54
+ origin: options.pluginId,
55
+ });
56
+ }
53
57
  if (options.sms) {
54
58
  app.addHandler(userLoginByTokenHandler, {
55
59
  method: flink_1.HttpMethod.post,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flink-app/generic-auth-plugin",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Flink plugin that provides a generic user authentification solution.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\"",
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "@flink-app/email-plugin": "^0.5.0",
20
20
  "@flink-app/jwt-auth-plugin": "^0.5.0",
21
- "@flink-app/management-api-plugin": "^0.5.0",
21
+ "@flink-app/management-api-plugin": "^0.5.2",
22
22
  "@flink-app/sms-plugin": "^0.5.0",
23
23
  "handlebars": "^4.7.7",
24
24
  "jsonwebtoken": "^8.5.1"
@@ -30,5 +30,5 @@
30
30
  "ts-node": "^9.1.1",
31
31
  "typescript": "^4.2.4"
32
32
  },
33
- "gitHead": "3c877c210da19119c074c7482e97a485d2334e80"
33
+ "gitHead": "be187fbc7eaccd2dd18db7e15e703bfa811c9375"
34
34
  }
@@ -9,6 +9,7 @@ export interface GenericAuthPluginOptions {
9
9
  enableUserCreation?: boolean;
10
10
  enableProfileUpdate?: boolean;
11
11
  enablePasswordUpdate?: boolean;
12
+ enableUserLogin?: boolean;
12
13
  baseUrl?: string;
13
14
  pluginId?: string;
14
15
  createPasswordHashAndSaltMethod?: {
package/src/init.ts CHANGED
@@ -17,15 +17,19 @@ export function init(app: FlinkApp<any>, options: GenericAuthPluginOptions) {
17
17
  if (options.enableUserCreation == null) options.enableUserCreation = true;
18
18
  if (options.enableProfileUpdate == null) options.enableProfileUpdate = true;
19
19
  if (options.enablePasswordUpdate == null) options.enablePasswordUpdate = true;
20
+ if (options.enableUserLogin == null) options.enableUserLogin = true;
21
+
20
22
  if (options.baseUrl == null) options.baseUrl = "/user";
21
23
 
22
24
  if (options.enableRoutes) {
23
- app.addHandler(userLoginHandler, {
24
- method: HttpMethod.post,
25
- path: options.baseUrl + "/login",
26
- docs: "Authenticates a user",
27
- origin: options.pluginId,
28
- });
25
+ if(options.enableUserLogin){
26
+ app.addHandler(userLoginHandler, {
27
+ method: HttpMethod.post,
28
+ path: options.baseUrl + "/login",
29
+ docs: "Authenticates a user",
30
+ origin: options.pluginId,
31
+ });
32
+ }
29
33
  if(options.sms){
30
34
  app.addHandler(userLoginByTokenHandler, {
31
35
  method: HttpMethod.post,