Skip to content
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 @@ -10,7 +10,7 @@ class Raw::ReleaseArtifactsController < Api::V1::BaseController
def show
authorize! artifact

redirect_to vanity_v1_account_release_artifact_url(artifact.account, artifact, filename: artifact.filename, host: request.host),
redirect_to vanity_v1_account_release_artifact_url(artifact.account, artifact, filename: artifact.filename, host: request.host, params: request.query_parameters),
status: :see_other
end

Expand Down
22 changes: 21 additions & 1 deletion features/api/v1/engines/raw/show.feature
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ Feature: Raw artifact download
{ "Location": "https://api.keygen.sh/v1/accounts/29b60e24-f18a-4c6a-9e86-da3116c52f30/artifacts/b49e82e3-911d-49b0-8548-15fbf1ffbdd6/relay_windows_386.exe" }
"""

Scenario: License downloads an artifact they have access to
Scenario: License downloads an artifact they have access to (header auth)
Given the current account has 1 "policy" with the following:
"""
{
Expand All @@ -306,6 +306,26 @@ Feature: Raw artifact download
{ "Location": "https://api.keygen.sh/v1/accounts/29b60e24-f18a-4c6a-9e86-da3116c52f30/artifacts/a8e49ea6-17df-4798-937f-e4756e331db5/keygen_darwin_arm64" }
"""

Scenario: License downloads an artifact they have access to (query auth)
Given the current account has 1 "policy" with the following:
"""
{
"productId": "6198261a-48b5-4445-a045-9fed4afc7735",
"authenticationStrategy": "LICENSE"
}
"""
And the current account has 1 "license" for the last "policy" with the following:
"""
{ "key": "test-key" }
"""
And I am a license of account "keygen"
When I send a GET request to "/accounts/keygen/engines/raw/cli/1.0.0/keygen_darwin_arm64?auth=license:test-key"
Then the response status should be "303"
And the response should contain the following headers:
"""
{ "Location": "https://api.keygen.sh/v1/accounts/29b60e24-f18a-4c6a-9e86-da3116c52f30/artifacts/a8e49ea6-17df-4798-937f-e4756e331db5/keygen_darwin_arm64?auth=license%3Atest-key" }
"""

Scenario: License downloads an artifact they don't have access to
Given the current account has 1 "policy" with the following:
"""
Expand Down