Skip to content

Commit 5092827

Browse files
authored
fix: support newer location of ias auth (#15)
* fix: support newer location of ias auth * changelog * .
1 parent 66e1c4c commit 5092827

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55
The format is based on [Keep a Changelog](http://keepachangelog.com/).
66

7+
## Version 0.1.1 - 2024-11-12
8+
9+
### Added
10+
11+
- Support for `@sap/cds` >= 8.5.0 (modified `ias-auth` middleware path)
12+
713
## Version 0.1.0 - 2024-09-27
814

915
### Added

cds-plugin.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,12 @@ class EventBroker extends cds.MessagingService {
282282
usedWebhookEndpoints.add(webhookBasePath)
283283
// auth
284284
if (this.auth.kind === 'ias') {
285-
const ias_auth = require('@sap/cds/lib/auth/ias-auth')
285+
let ias_auth
286+
try {
287+
ias_auth = require('@sap/cds/lib/srv/middlewares/auth/ias-auth.js')
288+
} catch {
289+
ias_auth = require('@sap/cds/lib/auth/ias-auth') // fallback for older @sap/cds version
290+
}
286291
cds.app.use(webhookBasePath, cds.middlewares.context())
287292
cds.app.use(webhookBasePath, ias_auth(this.auth.ias))
288293
cds.app.use(webhookBasePath, (err, _req, res, next) => {

0 commit comments

Comments
 (0)