Fix file permissions for developer key and auth cookie (#3024)

* fix permissions

* include read for group
This commit is contained in:
Mariusz Kogen
2025-09-16 17:09:33 +02:00
committed by GitHub
parent 68414678d8
commit 1d331d7810
2 changed files with 2 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ pub async fn write_developer_key(
secret_key: secret.to_bytes(),
public_key: Some(PublicKeyBytes(VerifyingKey::from(secret).to_bytes())),
};
let mut file = create_file_mod(path, 0o046).await?;
let mut file = create_file_mod(path, 0o640).await?;
file.write_all(
keypair_bytes
.to_pkcs8_pem(base64ct::LineEnding::default())

View File

@@ -43,7 +43,7 @@ pub trait AuthContext: SignatureAuthContext {
const LOCAL_AUTH_COOKIE_OWNERSHIP: &str;
fn init_auth_cookie() -> impl Future<Output = Result<(), Error>> + Send {
async {
let mut file = create_file_mod(Self::LOCAL_AUTH_COOKIE_PATH, 0o046).await?;
let mut file = create_file_mod(Self::LOCAL_AUTH_COOKIE_PATH, 0o640).await?;
file.write_all(BASE64.encode(random::<[u8; 32]>()).as_bytes())
.await?;
file.sync_all().await?;