google / go-cloud

The Go Cloud Development Kit (Go CDK): A library and tools for open cloud development in Go.
https://gocloud.dev/
Apache License 2.0
9.57k stars 812 forks source link

blob/fileblob: Make it possible to set the permissions used in CreateDir #3423

Closed stanhu closed 7 months ago

stanhu commented 7 months ago

Is your feature request related to a problem? Please describe.

Currently fileblob sets the permissions to 0777: https://github.com/google/go-cloud/blob/be1b4aee38955e1b8cd1c46f8f47fb6f9d820a9b/blob/fileblob/fileblob.go#L268

We use fileblob to store backups, and we'd prefer this not be world-readable. We'd like to lock this down and use perm.PrivateDir or 0700. It'd be nice to make that the default or make it configurable.

For now, we'll just use os.MkdirAll ourselves.