Skip to content

Commit e7f4dab

Browse files
Revert ". (#14)" (#17)
This reverts commit 28fa61b.
1 parent 28fa61b commit e7f4dab

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

cds-plugin.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ class EventBroker extends cds.MessagingService {
135135

136136
this.auth = {} // { kind: 'cert', validationCert?, privateKey? } or { kind: 'ias', ias }
137137

138-
console.log('cds.env.requires:', cds.env.requires)
139-
140138
// determine auth.kind
141139
if (this.options.x509) {
142140
if (!this.options.x509.cert && !this.options.x509.certPath)
@@ -157,8 +155,6 @@ class EventBroker extends cds.MessagingService {
157155
} else this.auth.kind = 'cert'
158156
}
159157

160-
console.log('this.auth:', this.auth)
161-
162158
if (!this.auth.kind || (this.auth.kind === 'ias' && !this.auth.ias))
163159
throw new Error(`${this.name}: Event Broker requires your app to be bound to an IAS instance.`)
164160

@@ -335,19 +331,15 @@ class EventBroker extends cds.MessagingService {
335331
Object.assign(msg.headers, headers)
336332
if (this.isMultitenancy) msg.tenant = tenant
337333

334+
// for cds.context.http
338335
msg._ = {}
339336
msg._.req = req
340337
msg._.res = res
341338

342339
const context = { user: cds.User.privileged, _: msg._ }
343340
if (msg.tenant) context.tenant = msg.tenant
344341

345-
346-
await this.tx(context, tx => {
347-
if (cds.context.http?.req?.headers?.authorization) delete cds.context.http.req.headers.authorization // potential destination lookup fails if IAS token is used
348-
return tx.emit(msg)
349-
})
350-
342+
await this.tx(context, tx => tx.emit(msg))
351343
this.LOG.debug('Event processed successfully.')
352344
return res.status(200).json({ message: 'OK' })
353345
} catch (e) {

0 commit comments

Comments
 (0)