Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d82cc493
Commit
d82cc493
authored
Feb 09, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add #url monkey patch to return https:// private urls
parent
d2d0aa4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
config/initializers/fog_google_https_private_urls.rb
config/initializers/fog_google_https_private_urls.rb
+17
-0
spec/initializers/fog_google_https_private_urls_spec.rb
spec/initializers/fog_google_https_private_urls_spec.rb
+24
-0
No files found.
config/initializers/fog_google_https_private_urls.rb
0 → 100644
View file @
d82cc493
module
Fog
module
Storage
class
GoogleXML
class
File
<
Fog
::
Model
module
MonkeyPatch
# Monkey patch this to use `get_https_url`
def
url
(
expires
)
requires
:key
collection
.
get_https_url
(
key
,
expires
)
end
end
prepend
MonkeyPatch
end
end
end
end
spec/initializers/fog_google_https_private_urls_spec.rb
0 → 100644
View file @
d82cc493
require
'spec_helper'
describe
Fog
::
Storage
::
GoogleXML
::
File
do
let
(
:storage
)
do
Fog
.
mock!
Fog
::
Storage
.
new
({
google_storage_access_key_id:
"asdf"
,
google_storage_secret_access_key:
"asdf"
,
provider:
"Google"
})
end
let
(
:file
)
do
directory
=
storage
.
directories
.
create
(
key:
'data'
)
directory
.
files
.
create
(
body:
'Hello World!'
,
key:
'hello_world.txt'
)
end
it
'delegates to #get_https_url'
do
expect
(
file
.
url
(
Time
.
now
)).
to
start_with
(
"https://"
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment