Skip to content

Commit

Permalink
Remove the files and tests contains token and private key (#861)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoluz authored Jun 23, 2023
1 parent 2c4f1df commit 1b02c01
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 225 deletions.
1 change: 0 additions & 1 deletion src/nginx/t/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ nginx_suite(
"check_report_body.t",
"check_report_metrics.t",
"check_return_403.t",
"check_with_token.t",
"config_extra_field.t",
"config_missing.t",
"config_rollouts_by_timer.t",
Expand Down
15 changes: 0 additions & 15 deletions src/nginx/t/auth_pkey.t
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,6 @@ GET /shelves HTTP/1.0
Host: localhost
Authorization: Bearer invalid.token
EOF
like($response, qr/HTTP\/1\.1 401 Unauthorized/, 'Returned HTTP 401, invalid token.');
like($response, qr/WWW-Authenticate: Bearer, error=\"invalid_token\"/, 'Returned invalid_token challenge.');
like($response, qr/Content-Type: application\/json/i,
'Invalid token returned application/json body.');
like($response, qr/JWT validation failed: Bad JWT format: Invalid JSON in header/i,
"Error body contains 'invalid token'.");

# Token generated from different issuer/key.
my $token = Auth::get_auth_token('./src/nginx/t/wrong-client-secret.json');
$response = ApiManager::http($NginxPort,<<"EOF");
GET /shelves HTTP/1.0
Host: localhost
Authorization: Bearer $token
EOF
like($response, qr/HTTP\/1\.1 401 Unauthorized/, 'Returned HTTP 401, no matching pkey.');
like($response, qr/WWW-Authenticate: Bearer, error=\"invalid_token\"/, 'Returned invalid_token challenge.');
Expand Down
202 changes: 0 additions & 202 deletions src/nginx/t/check_with_token.t

This file was deleted.

7 changes: 0 additions & 7 deletions src/nginx/t/wrong-client-secret.json

This file was deleted.

0 comments on commit 1b02c01

Please sign in to comment.