Skip to content

Commit 4f6735a

Browse files
feat: Add supported feature reporting (#31)
1 parent 0243d01 commit 4f6735a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

SPEC.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,9 @@ When the launcher receives the signal `SIGINT` (or `CTRL_C_EVENT` on Windows), i
5656
* `--domain=<DOMAIN>`: Specifies a domain that the gateway will respond to (corresponding to the `Host` HTTP header). This flag is repeatable.
5757
* `--pocketic-config-bind=<IP>`: Specifies a network interface to bind the PocketIC config API to.
5858
* `--custom-domains-file=<FILE>`: Specifies a text file mapping domains of the gateway to canister IDs, in `domain:principal` format, one per line. If unset, and `--status-dir` is set, defaults to `<status dir>/custom-domains.txt`.
59+
60+
### Output
61+
62+
The `status.json` file has an additional optional field: `supported_features` of type []string, a list of capabilities that the active launcher supports. This array is for features where the caller must change its behavior based on whether or not the launcher understood a particular flag. Callers must not reject unknown reported features.
63+
64+
There is only one reported feature right now: `"custom-domains"`. This string should be added to the array when the gateway supports custom domains from `--custom-domains-file`. This permits callers to know what format of URL to display.

src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ async fn main() -> anyhow::Result<()> {
343343
.expect("root key should be available if there is a root subnet"),
344344
),
345345
default_effective_canister_id: default_ecid,
346+
supported_features: vec!["custom-domains".to_string()],
346347
};
347348
let mut contents = serde_json::to_string(&status).expect("infallible serialization");
348349
contents.push('\n');
@@ -521,4 +522,5 @@ struct Status {
521522
gateway_port: u16,
522523
root_key: String,
523524
default_effective_canister_id: Principal,
525+
supported_features: Vec<String>,
524526
}

0 commit comments

Comments
 (0)