Skip to content

Commit 9e34ccb

Browse files
committed
fix code formatting
1 parent 9227c50 commit 9e34ccb

2 files changed

Lines changed: 2 additions & 16 deletions

File tree

lib/cloudconvert/signed_url.rb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
11
module CloudConvert
22
class SignedUrl
3-
43
class << self
5-
64
# @param base [String] The base from for your signed URL settings.
75
# @param signing_secret [String] The signing secret from for your signed URL settings.
86
# @param job [Hash] The job to create the signed URL for
97
# @param cache_key [String] Allows caching of the result file for 24h
108
# @return [String] The signed URL
119
def sign(base, signing_secret, job, cache_key = nil)
12-
1310
url = base
1411

15-
url += "?job=" + Base64.urlsafe_encode64(job.to_json, :padding => false)
12+
url += "?job=" + Base64.urlsafe_encode64(job.to_json, padding: false)
1613

1714
unless cache_key.nil?
1815
url += "&cache_key=" + cache_key
1916
end
2017

2118
url += "&s=" + OpenSSL::HMAC.hexdigest("SHA256", signing_secret, url)
2219

23-
return url
24-
20+
url
2521
end
26-
27-
2822
end
2923
end
3024
end

spec/signed_url_spec.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
describe CloudConvert::SignedUrl, :unit do
2-
payload = fixture("requests/webhook_job_finished_payload.json").read
3-
signature = "576b653f726c85265a389532988f483b5c7d7d5f40cede5f5ddf9c3f02934f35"
4-
invalid_signature = SecureRandom.alphanumeric(64)
5-
secret = "secret"
6-
72
describe ".sign" do
83
it "should return a signed url" do
9-
104
job = {
115
tasks: {
126
"import-it": { operation: "import/url", filename: "test.file", url: "http://invalid.url" },
@@ -26,8 +20,6 @@
2620
expect(url).to include "?job="
2721
expect(url).to include "&cache_key=mykey"
2822
expect(url).to include "&s=3fb529168264bccea28ba9a1d02f2a4662d1917029829ee77e753a7748b98904"
29-
3023
end
31-
3224
end
3325
end

0 commit comments

Comments
 (0)