Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bucket names with dashes in them cause errors in mocks #598

Open
mateomurphy opened this issue Jun 30, 2023 · 2 comments
Open

Bucket names with dashes in them cause errors in mocks #598

mateomurphy opened this issue Jun 30, 2023 · 2 comments

Comments

@mateomurphy
Copy link

I'm running into an issue when trying to mock google storage:

storage = Fog::Storage::Google.new({
  :google_storage_access_key_id => "id",
  :google_storage_secret_access_key => "key"
})

bucket = storage.directories.create(key: "name")

pp bucket.files.all # returns []

bucket = storage.directories.create(key: "name-with-dashes")

pp bucket.files.all # raises Excon::Error::BadRequest

This happens because this line of code rejects names that have non word characters in them:
https://github.com/fog/fog-google/blob/master/lib/fog/storage/google_xml/requests/get_bucket.rb#L52

However according to google's documentation, dashes, underscores and dots are legal:
https://cloud.google.com/storage/docs/buckets#naming

@mateomurphy
Copy link
Author

BTW I forked and modified this, and can submit a PR if that would be helpful

@Temikus
Copy link
Member

Temikus commented Aug 10, 2023

@mateomurphy very! Please do 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants