Skip to content

Conversation

@nikmace
Copy link
Contributor

@nikmace nikmace commented Oct 31, 2025

Feat for #3789.

  • Adds a new middleware that adds a token for each request to OData for Cloud Foundry ADP.
  • Changes the CF project structure to support the new middleware and work in preview and in Adaptation Editor.
  • Adjust preview-middleware code to support CF projects.

@nikmace nikmace self-assigned this Oct 31, 2025
@nikmace nikmace requested review from a team as code owners October 31, 2025 09:22
@nikmace nikmace added preview-middleware @sap-ux/preview-middleware adp-tooling generator-adp @sap-ux/generator-adp labels Oct 31, 2025
@changeset-bot
Copy link

changeset-bot bot commented Oct 31, 2025

🦋 Changeset detected

Latest commit: a05b3b4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@sap-ux/backend-proxy-middleware-cf Patch
@sap-ux/preview-middleware Patch
@sap-ux/generator-adp Patch
@sap-ux/adp-tooling Patch
@sap-ux/create Patch
@sap-ux/adp-flp-config-sub-generator Patch
@sap-ux/flp-config-inquirer Patch
@sap-ux/flp-config-sub-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nikmace nikmace requested a review from a team as a code owner October 31, 2025 10:13
@IainSAP
Copy link
Contributor

IainSAP commented Nov 10, 2025

@nikmace Using CF to discover systems and connect is something we already support using axios-extension and https://github.com/SAP/open-ux-tools/blob/main/packages/odata-service-inquirer/src/prompts/datasources/sap-system/abap-on-btp/questions.ts#L216. Is this not sufficent for this use case. Any connectivity features should be added to axios extension, but I believe there is nothing new here?

@nikmace
Copy link
Contributor Author

nikmace commented Nov 10, 2025

@nikmace Using CF to discover systems and connect is something we already support using axios-extension and https://github.com/SAP/open-ux-tools/blob/main/packages/odata-service-inquirer/src/prompts/datasources/sap-system/abap-on-btp/questions.ts#L216. Is this not sufficent for this use case. Any connectivity features should be added to axios extension, but I believe there is nothing new here?

Our use case is completely different. We are trying to support Cloud Foundry Adaptation Projects in the Adaptation Editor - that is the goal. We are not having issues with connectivity, and I don't see a reason to enhance axios-extension because we don't need to use any methods from it like we do with AbapServiceProvider (ABAP and Cloud Foundry are two different things).

All we need to do is get the service keys from business service, make a call to fetch an authorization token, and attach it to the request headers. Then, authentication is going to happen programatically, service-to-service. For example, for OData, which is linked to a destination and needs authorization. Maybe I don't understand something but I can't see how enhacing axios-extension is going to help us.

We are talking about different scenarios, in my opinion. Let's follow up during the meeting. 👍🏻

Copy link
Contributor

@heimwege heimwege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments. I just had a look at the backend-proxy-middleware-cf and preview-middleware changes. Can't really comment on the adp packages.

* @param logger logger instance
* @throws Error in case no manifest.appdescr_variant found
*/
export async function initAdp(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Why is initAdp not a function of the class FlpSandbox? As it seems to rely on a specific instance flp: FlpSandbox this could be improved by just making it a function of that instance so that this can be used. Also flp as property name is misleading because there's a config property of the preview-middleware named flp as well.
I know all of this is not related to this PR but something I learned doing the review 🐱

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed In: 4bcb65b

@mmilko01 mmilko01 requested a review from a team as a code owner November 26, 2025 12:17
@mmilko01 mmilko01 force-pushed the feat/3789/cf-adp-support branch from a08292f to 84c8e54 Compare November 26, 2025 12:36
@nikmace nikmace removed the request for review from a team November 26, 2025 12:36
await validateConfig(config, logger);

const tokenProvider = await createTokenProvider(config, logger);
return setupProxyRoutes(config.paths, config.url, tokenProvider, logger) as unknown as RequestHandler;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cast is not needed because Express's Router type extends RequestHandler

Suggested change
return setupProxyRoutes(config.paths, config.url, tokenProvider, logger) as unknown as RequestHandler;
return setupProxyRoutes(config.paths, config.url, tokenProvider, logger);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in: 8a156d6

Comment on lines 49 to 51
"ui5": {
"dependencies": []
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that one can be deleted. This is a very old and was need for UI5 cli v2.x (link)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in: 8a156d6

@nikmace nikmace requested a review from heimwege November 27, 2025 07:40
@sonarqubecloud
Copy link

Copy link
Contributor

@voicis voicis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adp-tooling generator-adp @sap-ux/generator-adp preview-middleware @sap-ux/preview-middleware

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants