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

Add OIDC proxy integration tests #2953

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
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
624 changes: 312 additions & 312 deletions Jenkinsfile

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions ci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ services:
python /usr/src/jwks/jwks_server.py -p 8090
volumes:
- ./jwt/:/usr/src/jwks/

tinyproxy:
image: travix/tinyproxy
ports:
- 8888:8888
volumes:
- ./test_suites/authenticators_oidc/proxy/tinyproxy.conf:/etc/tinyproxy.conf

volumes:
authn-local:
Expand Down
15 changes: 15 additions & 0 deletions ci/test_suites/authenticators_oidc/proxy/tinyproxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
User tinyproxy
Group tinyproxy
Port 8888
Timeout 600
DefaultErrorFile "/usr/share/tinyproxy/default.html"
StatHost "tinyproxy.stats"
LogFile "/var/log/tinyproxy/tinyproxy.log"
LogLevel Info
MaxClients 100
MinSpareServers 5
MaxSpareServers 20
StartServers 10
MaxRequestsPerChild 0

ViaProxyName "tinyproxy"
2 changes: 1 addition & 1 deletion ci/test_suites/authenticators_oidc/test
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function main() {
$COMPOSE exec "${parallel_service}" rm "/etc/ssl/certs/$hash.0" || true
done

additional_services='ldap-server keycloak'
additional_services='ldap-server keycloak tinyproxy'
_run_cucumber_tests authenticators_oidc "$additional_services" \
_hydrate_all_env_args
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@
@scenario_context.add(variable_hash['context_variable'].to_sym, value)
end
end

Given(/^I set environment variable "([^"]*)" to "([^"]*)"$/) do |variable_name, variable_value|
ENV[variable_name] = variable_value
end
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def load_root_policy(policy)
def get(path, options = {})
options = options.merge(
method: :get,
url: path
url: path,
proxy: nil
)
result = RestClient::Request.execute(options)
@response_body = result.body
Expand All @@ -84,6 +85,9 @@ def get(path, options = {})
end

def post(path, payload, options = {})
options = options.merge(
proxy: nil
)
result = RestClient.post(path, payload, options)
@response_body = result.body
@http_status = result.code
Expand All @@ -94,6 +98,9 @@ def post(path, payload, options = {})
end

def execute(method, path, payload = {}, options = {})
options = options.merge(
proxy: nil
)
result = RestClient::Request.execute(method: method, url: path, payload: payload, **options)
@response_body = result.body
@http_status = result.code
Expand Down
1 change: 1 addition & 0 deletions cucumber/api/features/support/logs_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def num_matches_since_savepoint(msg)

start_line = @saved_num_lines
end_line = cur_num_lines
puts "Logs since savepoint: #{File.readlines(LOG_LOCATION)[start_line..end_line]}"
File.readlines(LOG_LOCATION)[start_line..end_line].grep(/#{msg}/i).count
end

Expand Down
86 changes: 0 additions & 86 deletions cucumber/authenticators_jwt/features/authn_jwt.feature

This file was deleted.

119 changes: 0 additions & 119 deletions cucumber/authenticators_jwt/features/authn_jwt_ca_cert.feature

This file was deleted.

Loading
Loading