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

Allow to send arbitrary extension attributes #376

Open
ctron opened this issue Feb 20, 2023 · 1 comment
Open

Allow to send arbitrary extension attributes #376

ctron opened this issue Feb 20, 2023 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@ctron
Copy link
Member

ctron commented Feb 20, 2023

Summarizing the chat discussion with @rmja

It would be good to allow devices (protocol endpoints) to send arbitrary header fields, which translate into CloudEvents (CE) extension attributes.

As some extension attributes cannot be allowed to be set by external actors (like the id value, the "partition key" , or distributed tracing information) such fields need to be either filtered out, or rejected. An alternative would be to simply prefix everything with e.g. drogue-, which would scope/namespace such attributes and prevent any collision.

While the core attributes of CE are known (at this point), the full set of attributes (including all extensions) is not. So using a prefix makes the implementation much easier.

The proposed solution is:

  • Allow any endpoint to provide additional extension attributes (which must be able to be translated into CE attributes)
  • Have each endpoint provide a way (API) to let devices specify such attributes (start with HTTP)
  • Translate the incoming attributes to CE attributes, prefixing them with (e.g.) drogue-.

For HTTP this could simply mean adding every query parameter that starts with attr. (or meta. or ext.) to the extension attributes. Like:

?attr.foo=bar

Resulting in:

drogue-foo: bar
@ctron ctron added enhancement New feature or request help wanted Extra attention is needed labels Feb 20, 2023
@ctron ctron added this to the 0.12.0 milestone Feb 20, 2023
@ctron
Copy link
Member Author

ctron commented Feb 20, 2023

Additional thought: For HTTP, we could allow translating all Drogue-Attr- prefixed headers as extension attributes too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: No status
Development

No branches or pull requests

1 participant