Skip to content

Add App Context extension#1379

Open
inlined wants to merge 4 commits intocloudevents:mainfrom
inlined:add-app-context
Open

Add App Context extension#1379
inlined wants to merge 4 commits intocloudevents:mainfrom
inlined:add-app-context

Conversation

@inlined
Copy link
Contributor

@inlined inlined commented Mar 17, 2026

Fixes (N/A)

Adds an extension to document future features Google is exploring so that there can be industry standardization

Proposed Changes

Document an extension to indicate an app that triggered an event. Allows for a BaaS-opque identifier as well as app store specific identifiers for Android and iOS.

Release Note

(feat) extensions: add appcontext extension

Signed-off-by: Thomas Bouldin <inlined@google.com>
@duglin
Copy link
Collaborator

duglin commented Mar 17, 2026

Hey @inlined ! Been a while!

Could you elaborate a bit on how you see this being used w/o conflicting with source and/or subject? The latest spec talks about how either of those could be compound strings made up of more than one "thing", so it might include appid and bundleid

Signed-off-by: Thomas Bouldin <inlined@google.com>
@inlined
Copy link
Contributor Author

inlined commented Mar 17, 2026

Hey Dug, always a pleasure!

Think of this as another form of AuthN rather than a true source. So a write was made against the Firebase Realtime Database. That is the source of the event. And we tell you the human who made the change to that database with the authcontext extension. This would allow you to also track the app that human used.

Can be used for a variety of purposes from tracking sources of engagement with particular features to applying bugfixes surgically to known bad versions of an app.

Has the spec changed so much since I was last looking at it that source/subject should be the app and not the database in this example?

### 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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It must follow Android package naming conventions: it must have at least two segments,
It MUST follow Android package naming conventions: it MUST have at least two segments,

- 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
separated by periods (`.`); each segment must start with a letter; and all characters
separated by periods (`.`); each segment MUST start with a letter; and all characters

- 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_]`).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
must be alphanumeric or an underscore (`[a-zA-Z0-9_]`).
MUST be alphanumeric or an underscore (`[a-zA-Z0-9_]`).

### 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It must follow Apple bundle naming conventions: it must contain only alphanumeric
It MUST follow Apple bundle naming conventions: it MUST contain only alphanumeric

### 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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It MUST follow Android package naming conventions: it must have at least two segments,
It MUST follow Android package naming conventions: it MUST have at least two segments,

### 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It MUST follow Apple bundle naming conventions: it must contain only alphanumeric
It MUST follow Apple bundle naming conventions: it MUST contain only alphanumeric

@duglin
Copy link
Collaborator

duglin commented Mar 17, 2026

Your example and AuthN commentary helps a lot - thanks!

Signed-off-by: Thomas Bouldin <inlined@google.com>
@inlined inlined requested a review from duglin March 17, 2026 23:08
@duglin
Copy link
Collaborator

duglin commented Mar 19, 2026

@inlined we briefly discussed this on the weekly call and there were no major objections. @jskeet has a few questions that he'll ask as PR comments, and I have one more: any reason not to generalize the naming a bit more? E.g. "appid" seem pretty specific - would it lose value if we picked a phase like "initiatorid" or "clientid", or something that could then make sense in a non-mobile-app case but still falls into a similar category of usecases/workflows?


<!-- no-verify-translation -->

This extension gives information about a mobile app that triggered an event.
Copy link
Contributor

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.


## Attributes

### appid
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

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

Successfully merging this pull request may close these issues.

3 participants