Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to specify path and/or additional headers for "emit" request. #52

Closed
alexdebrie opened this issue Jul 13, 2018 · 1 comment

Comments

@alexdebrie
Copy link
Contributor

Subscriptions are set up on a path, so events may need to be emitted on a path.

Further, a user may want to include additional headers with the emit() request, such as an Authorization header used for Auth.

A proposed update to the emit() signature could be:

eventGateway.emit(<CloudEvents object>, <Options>)

The usage would look like:

eventGateway.emit({
  eventID: '1',
  eventType: 'user.created',
  cloudEventsVersion: '0.1',
  source: '/services/users',
  contentType: 'application/json',
  data: {
    userID: 'foo'
  }}, {
  path: /users,
  headers: {
    "Authorization": "Bearer 1234"
  }
})
@mthenw
Copy link
Contributor

mthenw commented Jul 24, 2018

Yeah, makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants