-
Notifications
You must be signed in to change notification settings - Fork 612
Add App Context extension #1379
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
Open
inlined
wants to merge
4
commits into
cloudevents:main
Choose a base branch
from
inlined:add-app-context
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # App Context | ||
|
|
||
| <!-- no-verify-translation --> | ||
|
|
||
| This extension gives information about a mobile app that triggered an event. | ||
| This is a way to authenticate the app that triggered an event, orthogonally | ||
| to a source. | ||
|
|
||
| For example, in an end-user accessible backend like a Supabase or Firebae database, | ||
| the source of a data change event is the database. But the authentication for that | ||
| write might be the user (covered by the [authcontext](./authcontext.md) extension) | ||
| and the app that triggered the event (covered by this extension). | ||
|
|
||
| Common uses can be to track engagement with a particular app, or to | ||
| allow a backend to enforce policies based on the app that triggered | ||
| an event. For example, either the user or the app can be used to identify | ||
| whether an AI API could have high or low rate limits, expensive or cost effective | ||
| models, etc. | ||
|
|
||
| ## Notational Conventions | ||
|
|
||
| As with the main [CloudEvents specification](../spec.md), the key words "MUST", | ||
| "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", | ||
| "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as | ||
| described in [RFC 2119](https://tools.ietf.org/html/rfc2119). | ||
|
|
||
| However, the scope of these key words is limited to when this extension is | ||
| used. For example, an attribute being marked as "REQUIRED" does not mean | ||
| it needs to be in all CloudEvents, rather it needs to be included only when | ||
| this extension is being used. | ||
|
|
||
| ## Attributes | ||
|
|
||
| ### appid | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This and displayname are quite generic attribute names - I can imagine other extensions wanting to use similar names. Could a prefix be helpful here? |
||
| - Type: `String` | ||
| - Description: A cloud provider opaque string identifying the mapping of a given | ||
| app to a given backend. | ||
| - Constraints | ||
| - OPTIONAL | ||
|
|
||
| ### appdisplayname | ||
| - Type: `String` | ||
| - Description: How the app appears to users. | ||
| - Constraints | ||
| - OPTIONAL | ||
|
|
||
| ### androidpackagename | ||
| - Type: `String` | ||
| - Description: The Android package name of the app triggering the event. | ||
| It MUST follow Android package naming conventions: it MUST have at least two segments, | ||
| separated by periods (`.`); each segment MUST start with a letter; and all characters | ||
| MUST be alphanumeric or an underscore (`[a-zA-Z0-9_]`). | ||
| - Constraints | ||
| - OPTIONAL | ||
| - MUST be present if the app is an Android app. | ||
|
|
||
| ### iosbundleid | ||
| - Type: `String` | ||
| - Description: The Apple bundle identifier of the app triggering the event. | ||
| It MUST follow Apple bundle naming conventions: it MUST contain only alphanumeric | ||
| characters (`A-Z`, `a-z`, `0-9`), hyphens (`-`), and periods (`.`), typically adopting | ||
| a reverse-DNS format. | ||
| - Constraints | ||
| - OPTIONAL | ||
| - MUST be present if the app is an iOS app. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be expanded to include concrete examples? During the meeting on 2026-03-26 @duglin explained the reasoning for why appid can't be the subject or source, but if we had more description/examples here, we wouldn't need more justification.