Open in Google Play Console deep-links the app: Play developer id per credential profile (accounts play-developer, desktop Accounts), shared playAppUrl builder for desktop, CLI and watch; developer chooser instead of the console root
This commit is contained in:
parent
7c769c18f4
commit
4a74989a95
33 changed files with 311 additions and 40 deletions
|
|
@ -9,7 +9,7 @@ const FAKE_PEM: &str = "-----BEGIN PRIVATE KEY-----\nnot-a-real-key\n-----END PR
|
|||
|
||||
#[test]
|
||||
fn shown_metadata_carries_no_secret() {
|
||||
let a = Account { id: "abc".into(), label: "Studio Play".into(), kind: AccountKind::Play, created: "2026-10-10T00:00:00Z".into(), studio: Some("s1".into()), profile: Some("studio".into()) };
|
||||
let a = Account { id: "abc".into(), label: "Studio Play".into(), kind: AccountKind::Play, created: "2026-10-10T00:00:00Z".into(), studio: Some("s1".into()), profile: Some("studio".into()), developer_id: None };
|
||||
let v = serde_json::to_value(&a).unwrap();
|
||||
assert_eq!(v.as_object().unwrap().keys().cloned().collect::<Vec<_>>(), vec!["created", "id", "kind", "label", "profile", "studio"]);
|
||||
assert_eq!(v["kind"], "play");
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ impl SecretStore for MapStore {
|
|||
}
|
||||
|
||||
fn account(id: &str, label: &str, kind: AccountKind, profile: Option<&str>) -> Account {
|
||||
Account { id: id.into(), label: label.into(), kind, created: "2026-10-01T00:00:00Z".into(), studio: Some("s1".into()), profile: profile.map(str::to_string) }
|
||||
Account { id: id.into(), label: label.into(), kind, created: "2026-10-01T00:00:00Z".into(), studio: Some("s1".into()), profile: profile.map(str::to_string), developer_id: None }
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -244,3 +244,19 @@ fn ignored_flags_travel_between_the_registry_and_the_apps_ignore_keys() {
|
|||
let doc: serde_json::Value = serde_json::from_str(&std::fs::read_to_string(&file).unwrap()).unwrap();
|
||||
assert_eq!(doc["projects"][1]["ignored"], json!(["apple"]));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_play_developer_id_is_kept_in_the_profile_for_the_cli() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let store = ProfileStore::new(dir.path().join("credentials"), None);
|
||||
store.save("studio", "Studio", &Secret::Play { service_account: sa("bot@example.com") }).unwrap();
|
||||
assert_eq!(store.play_developer_id("studio"), None);
|
||||
store.set_play_developer_id("studio", Some("5550000000000000001")).unwrap();
|
||||
assert_eq!(store.play_developer_id("studio").as_deref(), Some("5550000000000000001"));
|
||||
let m = store.read("studio").unwrap();
|
||||
assert_eq!(m.get("PLAY_DEVELOPER_ID").and_then(|v| v.as_str()), Some("5550000000000000001"));
|
||||
assert!(m.contains_key("PLAY_SERVICE_ACCOUNT"));
|
||||
assert!(store.set_play_developer_id("studio", Some("abc")).is_err());
|
||||
store.set_play_developer_id("studio", None).unwrap();
|
||||
assert_eq!(store.play_developer_id("studio"), None);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue