dev-approuter 0.3.3 → 0.4.0

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 CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.4.0](https://github.com/ui5-community/ui5-ecosystem-showcase/compare/dev-approuter@0.3.4...dev-approuter@0.4.0) (2024-12-26)
7
+
8
+
9
+ ### Features
10
+
11
+ * **dev-approuter:** add custom /my-jwt route for debugging auth(n,z) ([#1134](https://github.com/ui5-community/ui5-ecosystem-showcase/issues/1134)) ([3e7b72b](https://github.com/ui5-community/ui5-ecosystem-showcase/commit/3e7b72b35403d964ad9977f6b77670d67e87b961)), closes [#1133](https://github.com/ui5-community/ui5-ecosystem-showcase/issues/1133)
12
+
13
+
14
+
15
+
16
+
17
+ ## [0.3.4](https://github.com/ui5-community/ui5-ecosystem-showcase/compare/dev-approuter@0.3.3...dev-approuter@0.3.4) (2024-12-04)
18
+
19
+ **Note:** Version bump only for package dev-approuter
20
+
21
+
22
+
23
+
24
+
6
25
  ## [0.3.3](https://github.com/ui5-community/ui5-ecosystem-showcase/compare/dev-approuter@0.3.2...dev-approuter@0.3.3) (2024-11-05)
7
26
 
8
27
  **Note:** Version bump only for package dev-approuter
package/README.md CHANGED
@@ -55,6 +55,9 @@ The `dev-approuter` is a wrapper for the SAP Application Router, meaning your cu
55
55
  ...
56
56
  }
57
57
  ```
58
+ ...or by passing a port as environment variable: `PORT=5001 npm run dev`
59
+
60
+ 4. Upon start, the `dev-approuter` exposes a custom endpoint `http://localhost:$port/my-jwt`. It echos the current JWT of the current (authenticated and authorized) user (or `none`) - this helps debugging auth(n,z) issues at dev time.
58
61
 
59
62
  ## Adding and serving apps
60
63
 
@@ -159,7 +159,14 @@ class DevApprouter {
159
159
 
160
160
  // create and start the SAP Approuter
161
161
  // https://help.sap.com/docs/btp/sap-business-technology-platform/extension-api-of-application-router
162
- approuter().start({
162
+ const _approuter = approuter();
163
+ // helper: if used in a hybrid setup w/ xsuaa,
164
+ // this endpoint helps to debug auth(n,z) issues
165
+ // DANGER, WILL SMITH: you must not use this in production envs!
166
+ _approuter.beforeRequestHandler.use("/my-jwt", (req, res) => {
167
+ res.end(req.session?.user?.token?.accessToken || "none")
168
+ })
169
+ _approuter.start({
163
170
  port: arPort,
164
171
  xsappConfig: applyDependencyConfig(config),
165
172
  extensions: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dev-approuter",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "A dev time wrapper for the SAP Application Router that can serve UI5 and CDS modules added as dependencies.",
5
5
  "author": "Nico Schoenteich <nicolai.schoenteich@sap.com> (https://github.com/nicoschoenteich)",
6
6
  "license": "Apache-2.0",
@@ -13,7 +13,7 @@
13
13
  "dependencies": {
14
14
  "@sap/approuter": ">=17.0.0",
15
15
  "@sap/xsenv": "5.4.0",
16
- "cds-plugin-ui5": "^0.11.1",
16
+ "cds-plugin-ui5": "^0.11.2",
17
17
  "express": "^4.21.1",
18
18
  "ui5-middleware-cap": "^3.3.0"
19
19
  },
@@ -25,5 +25,5 @@
25
25
  "optional": true
26
26
  }
27
27
  },
28
- "gitHead": "2605fafb84023ea02332b3b80befcb47e747ab84"
28
+ "gitHead": "d7bfddd86f2608c59882f226903dc9c142988567"
29
29
  }