Skip to content

Commit

Permalink
rename action
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorwolf committed Dec 25, 2023
1 parent 7896020 commit 4df2a7f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions srv/catalog-service.cds
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ service CatalogService @(requires: 'authenticated-user') {
@readonly
entity Products as projection on external.SEPMRA_C_PD_Product;

action getOAuth2SAMLBearerAssertion() returns String;
action readSAPLogonTicket() returns String;
action getBTPJWT() returns String;
action readSAPLogonTicket() returns String;
}
3 changes: 2 additions & 1 deletion srv/catalog-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = async function (srv) {
return productService.run(req.query);
});

srv.on("getOAuth2SAMLBearerAssertion", async (req) => {
srv.on("getBTPJWT", async (req) => {
const token = getAuthToken(req);
const authClient = new AuthClient();
LOG.debug("Token: " + token);
Expand All @@ -27,6 +27,7 @@ module.exports = async function (srv) {
token
);
LOG.debug("BTP Access Token: " + btpAccessToken);
return btpAccessToken;
});

srv.on("readSAPLogonTicket", async (req) => {
Expand Down
2 changes: 1 addition & 1 deletion test/catalog.http
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ GET http://localhost:6420/odata/v4/catalog/Products
&$top=10
Authorization: Bearer {{$dotenv token}}
###
POST http://localhost:6420/odata/v4/catalog/getOAuth2SAMLBearerAssertion
POST http://localhost:6420/odata/v4/catalog/getBTPJWT
Authorization: Bearer {{$dotenv token}}
Content-Type: application/json

Expand Down

0 comments on commit 4df2a7f

Please sign in to comment.