-
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add endpoints to get latest pacticipant version and latest tagg…
…ed version
- Loading branch information
Showing
7 changed files
with
109 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
class HalRelationProxyApp | ||
|
||
# This hash allows us to do a dodgy "generators" implementation | ||
# It means we can use placeholder URLS for the relations in our consumer tests so that | ||
# the consumer does not need to know the actual URLs. | ||
PATH_REPLACEMENTS = { | ||
'/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-TAGGED-VERSION-Condor-production' => | ||
'/pacticipants/Condor/versions/latest/production', | ||
'/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-VERSION-Condor' => | ||
'/pacticipants/Condor/versions/latest' | ||
} | ||
|
||
RESPONSE_BODY_REPLACEMENTS = { | ||
} | ||
|
||
def initialize(app) | ||
@app = app | ||
end | ||
|
||
def call env | ||
env_with_modified_path = env | ||
PATH_REPLACEMENTS.each do | (find, replace) | | ||
env_with_modified_path['PATH_INFO'] = env_with_modified_path['PATH_INFO'].gsub(find, replace) | ||
end | ||
|
||
response = @app.call(env_with_modified_path) | ||
|
||
modified_response_body = response.last.join | ||
RESPONSE_BODY_REPLACEMENTS.each do | (find, replace) | | ||
modified_response_body = modified_response_body.gsub(find, replace) | ||
end | ||
|
||
[response[0], response[1], [modified_response_body]] | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters