From f0252210b0cfc0f7db2a6115311dea2fb72c335c Mon Sep 17 00:00:00 2001 From: Thomas Bouldin Date: Tue, 17 Mar 2026 09:46:12 -0700 Subject: [PATCH 1/4] Add App Context extension Signed-off-by: Thomas Bouldin --- cloudevents/extensions/appcontext.md | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 cloudevents/extensions/appcontext.md diff --git a/cloudevents/extensions/appcontext.md b/cloudevents/extensions/appcontext.md new file mode 100644 index 000000000..c0e83cce7 --- /dev/null +++ b/cloudevents/extensions/appcontext.md @@ -0,0 +1,50 @@ +# App Context + +This extension gives information about a mobile app that triggered an event. + +## 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 +- Type: `String` +- Description: A cloud provider opaque string identifying the mapping of a given + app to a given backend. +- Constraints + - OPTIONAL + +### displayname +- 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. From 4be6b8a7c947af25e29e5d2f864c24364c4d970b Mon Sep 17 00:00:00 2001 From: Thomas Bouldin Date: Tue, 17 Mar 2026 11:19:56 -0700 Subject: [PATCH 2/4] Remove translation expectation Signed-off-by: Thomas Bouldin --- cloudevents/extensions/appcontext.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cloudevents/extensions/appcontext.md b/cloudevents/extensions/appcontext.md index c0e83cce7..b4cac5f37 100644 --- a/cloudevents/extensions/appcontext.md +++ b/cloudevents/extensions/appcontext.md @@ -1,5 +1,7 @@ # App Context + + This extension gives information about a mobile app that triggered an event. ## Notational Conventions @@ -32,9 +34,9 @@ this extension is being used. ### 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_]`). + 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. @@ -42,7 +44,7 @@ this extension is being used. ### 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 + 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 From b79791b877996ff04124de4f9c1219c64db50b0f Mon Sep 17 00:00:00 2001 From: Thomas Bouldin Date: Tue, 17 Mar 2026 16:06:44 -0700 Subject: [PATCH 3/4] Fixed mis-cased MUST Signed-off-by: Thomas Bouldin --- cloudevents/extensions/appcontext.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudevents/extensions/appcontext.md b/cloudevents/extensions/appcontext.md index b4cac5f37..13ff6edb2 100644 --- a/cloudevents/extensions/appcontext.md +++ b/cloudevents/extensions/appcontext.md @@ -34,7 +34,7 @@ this extension is being used. ### 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, + 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 @@ -44,7 +44,7 @@ this extension is being used. ### 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 + 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 From cb406af8735aea397c776a6694475376a4489009 Mon Sep 17 00:00:00 2001 From: Thomas Bouldin Date: Thu, 19 Mar 2026 12:54:18 -0700 Subject: [PATCH 4/4] PR feedback --- cloudevents/extensions/appcontext.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cloudevents/extensions/appcontext.md b/cloudevents/extensions/appcontext.md index 13ff6edb2..543f94fa9 100644 --- a/cloudevents/extensions/appcontext.md +++ b/cloudevents/extensions/appcontext.md @@ -3,6 +3,19 @@ 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 @@ -25,7 +38,7 @@ this extension is being used. - Constraints - OPTIONAL -### displayname +### appdisplayname - Type: `String` - Description: How the app appears to users. - Constraints