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

Stop exposing real account tokens in plaintext #7533

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@
end

context "with good credentials" do
let(:gemfury_deploy_token) { ENV.fetch("GEMFURY_DEPLOY_TOKEN", nil) }
let(:credentials) do
[{
"type" => "git_source",
Expand All @@ -464,12 +465,13 @@
}, {
"type" => "composer_repository",
"registry" => "php.fury.io",
"username" => "yFu9PBmw1HxNjFB818TW", # Throwaway account
"username" => gemfury_deploy_token,
"password" => ""
}]
end

it "has details of the updated item" do
skip("skipped because env var GEMFURY_DEPLOY_TOKEN is not set") if gemfury_deploy_token.nil?
expect(updated_lockfile_content).to include("\"version\":\"2.2.0\"")
end
end
Expand Down
8 changes: 6 additions & 2 deletions composer/spec/dependabot/composer/update_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@
end

context "with good credentials" do
let(:gemfury_deploy_token) { ENV.fetch("GEMFURY_DEPLOY_TOKEN", nil) }
let(:credentials) do
[{
"type" => "git_source",
Expand All @@ -339,12 +340,15 @@
}, {
"type" => "composer_repository",
"registry" => "php.fury.io",
"username" => "yFu9PBmw1HxNjFB818TW", # Throwaway account
"username" => gemfury_deploy_token,
"password" => ""
}]
end

it { is_expected.to be >= Gem::Version.new("2.2.0") }
it "returns the expected version" do
skip("skipped because env var GEMFURY_DEPLOY_TOKEN is not set") if gemfury_deploy_token.nil?
is_expected.to be >= Gem::Version.new("2.2.0")
end
end

context "with bad credentials" do
Expand Down
8 changes: 6 additions & 2 deletions hex/spec/dependabot/hex/update_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
end

context "with good credentials" do
let(:hex_pm_org_token) { ENV.fetch("HEX_PM_ORGANIZATION_TOKEN", nil) }
let(:credentials) do
[{
"type" => "git_source",
Expand All @@ -284,11 +285,14 @@
}, {
"type" => "hex_organization",
"organization" => "dependabot",
"token" => "b6294cd1e1cf158e9f65ea6b02a9a1ec"
"token" => hex_pm_org_token
}]
end

it { is_expected.to eq(Gem::Version.new("1.1.0")) }
it "returns the expected version" do
skip("skipped because env var HEX_PM_ORGANIZATION_TOKEN is not set") if hex_pm_org_token.nil?
is_expected.to eq(Gem::Version.new("1.1.0"))
end
end

context "with bad credentials" do
Expand Down
Loading