fix: grant default repository credential write access

This commit is contained in:
2026-09-23 02:57:48 +09:00
parent 91f356698b
commit 7905ea4054
3 changed files with 6 additions and 4 deletions
@@ -1123,7 +1123,7 @@ impl RepositorySecretService {
repository_key: repository_key.to_string(), repository_key: repository_key.to_string(),
credential_id: WORKSPACE_DEFAULT_REPOSITORY_SSH_CREDENTIAL_ID.to_string(), credential_id: WORKSPACE_DEFAULT_REPOSITORY_SSH_CREDENTIAL_ID.to_string(),
host_trust_id: host_trust.host_trust_id.clone(), host_trust_id: host_trust.host_trust_id.clone(),
access: RepositoryAccessMode::ReadOnly, access: RepositoryAccessMode::ReadWrite,
})) }))
} }
@@ -2377,7 +2377,7 @@ mod tests {
} }
#[test] #[test]
fn default_binding_resolves_unique_host_trust_for_url_and_scp_ssh_sources() { fn default_binding_is_read_write_for_unique_host_trust_and_ssh_sources() {
let (_dir, _store, service) = test_service(); let (_dir, _store, service) = test_service();
assert!( assert!(
service service
@@ -2418,7 +2418,7 @@ mod tests {
WORKSPACE_DEFAULT_REPOSITORY_SSH_CREDENTIAL_ID WORKSPACE_DEFAULT_REPOSITORY_SSH_CREDENTIAL_ID
); );
assert_eq!(binding.host_trust_id, "example"); assert_eq!(binding.host_trust_id, "example");
assert_eq!(binding.access, RepositoryAccessMode::ReadOnly); assert_eq!(binding.access, RepositoryAccessMode::ReadWrite);
} }
assert!( assert!(
service service
@@ -293,7 +293,7 @@
<div><p class="eyebrow">owner only</p><h2>Repository Access</h2></div> <div><p class="eyebrow">owner only</p><h2>Repository Access</h2></div>
<span class="badge success">encrypted</span> <span class="badge success">encrypted</span>
</header> </header>
<p>The Workspace default SSH key is generated separately from the Runtime authentication identity and is always offered during SSH clone. Without an explicit Repository binding, a unique pinned host trust matching the Repository URI is used with this default key. A binding can add one dedicated credential; OpenSSH receives both candidates and tries them through one operation-scoped agent. Private keys and passphrases remain write-only.</p> <p>The Workspace default SSH key is generated separately from the Runtime authentication identity and is always offered during SSH clone. Without an explicit Repository binding, a unique pinned host trust matching the Repository URI is used with this default key and normal read/write Git access. An explicit binding can select read-only access or add one dedicated credential; OpenSSH receives both credential candidates and tries them through one operation-scoped agent. Private keys and passphrases remain write-only.</p>
{#if message}<p class="status-message">{message}</p>{/if} {#if message}<p class="status-message">{message}</p>{/if}
<div class="settings-runtime-list"> <div class="settings-runtime-list">
@@ -77,6 +77,8 @@ test("Repository Access generates and copies selectable public keys", () => {
"publicKeys[credential.credential_id]", "publicKeys[credential.credential_id]",
"workspace-default", "workspace-default",
"always offered during SSH clone", "always offered during SSH clone",
"normal read/write Git access",
"explicit binding can select read-only access",
] ]
) { ) {
assert( assert(