As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit 79aed51b authored by Pablo Carranza's avatar Pablo Carranza
Browse files

Add encoding for the ssh key on the url

parent aedf824d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -57,7 +57,7 @@ class GitlabNet
end
def authorized_key(key)
resp = get("#{host}/authorized_keys?key=#{key}")
resp = get("#{host}/authorized_keys?key=#{URI.escape(key, '+/=')}")
JSON.parse(resp.body) if resp.code == "200"
rescue
nil
Loading
Loading
Loading
Loading
@@ -77,6 +77,8 @@ describe GitlabNet, vcr: true do
end
describe :authorized_key do
let (:ssh_key) { "AAAAB3NzaC1yc2EAAAADAQABAAACAQDPKPqqnqQ9PDFw65cO7iHXrKw6ucSZg8Bd2CZ150Yy1YRDPJOWeRNCnddS+M/Lk" }
it "should return nil when the resource is not implemented" do
VCR.use_cassette("ssh-key-not-implemented") do
result = gitlab_net.authorized_key("whatever")
Loading
Loading
@@ -93,7 +95,7 @@ describe GitlabNet, vcr: true do
it "should return a ssh key with a valid fingerprint" do
VCR.use_cassette("ssh-key-ok") do
result = gitlab_net.authorized_key("42:18:16")
result = gitlab_net.authorized_key(ssh_key)
result.should eq({
"created_at" => "2016-03-04T18:27:36.959Z",
"id" => 2,
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
http_interactions:
- request:
method: get
uri: https://dev.gitlab.org/api/v3/internal/authorized_keys?key=42:18:16
uri: https://dev.gitlab.org/api/v3/internal/authorized_keys?key=AAAAB3NzaC1yc2EAAAADAQABAAACAQDPKPqqnqQ9PDFw65cO7iHXrKw6ucSZg8Bd2CZ150Yy1YRDPJOWeRNCnddS+M/Lk
body:
encoding: US-ASCII
string: secret_token=a123
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment