summaryrefslogtreecommitdiff
path: root/lib/gitlab_lfs_authentication.rb
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-09-06 16:13:04 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-09-06 16:27:07 -0500
commita070ae4a320f8da830862e1dd11eea8b1281ab8c (patch)
treeac2083c8cc3263de7cbebe77677838514d82392a /lib/gitlab_lfs_authentication.rb
parentf53d09e1eb1323be9cd697813a6f47375c091f6a (diff)
downloadgitlab-shell-a070ae4a320f8da830862e1dd11eea8b1281ab8c.tar.gz
Style fixes and better tests.
Diffstat (limited to 'lib/gitlab_lfs_authentication.rb')
-rw-r--r--lib/gitlab_lfs_authentication.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab_lfs_authentication.rb b/lib/gitlab_lfs_authentication.rb
index 4b36229..196cdd7 100644
--- a/lib/gitlab_lfs_authentication.rb
+++ b/lib/gitlab_lfs_authentication.rb
@@ -11,11 +11,11 @@ class GitlabLfsAuthentication
end
def self.build_from_json(json)
- values = JSON.parse(json)
+ values = JSON.parse(json) rescue nil
self.new(values['username'], values['lfs_token'], values['repository_http_path'])
end
- def authenticate!
+ def authentication_payload
authorization = {
header: {
Authorization: "Basic #{Base64.strict_encode64("#{username}:#{lfs_token}")}"