-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tests for oauth login redirect
- Loading branch information
Showing
4 changed files
with
65 additions
and
14 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 was deleted.
Oops, something went wrong.
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,45 @@ | ||
config: | ||
env: | ||
CL_CONFIG_FILE: clace.toml | ||
CL_GITHUB_SECRET: ${CL_GITHUB_SECRET} | ||
tests: | ||
oauth0010: # copy sample app | ||
command: cp -r ../examples/disk_usage . | ||
|
||
oauth0020: ## create app with oauth auth | ||
command: ../clace app create --auth-type=github_test --approve /oauth1 ./disk_usage | ||
|
||
oauth0030: # check curl redirect to oauth provider | ||
command: curl localhost:25222/oauth1 | ||
stdout: | ||
exactly: '<a href="/_clace/auth/github_test">Temporary Redirect</a>.' # redirect to the auth url | ||
|
||
oauth0031: # update app to no auth | ||
command: ../clace app update auth-type /oauth1 none | ||
|
||
oauth0032: # check curl | ||
command: curl localhost:25222/oauth1 | ||
stdout: "Disk Usage" | ||
|
||
oauth0040: ## create app with invalid auth | ||
command: ../clace app create --auth-type=github --approve /oauth2 ./disk_usage | ||
stderr: "error: invalid authentication type github" | ||
exit-code: 1 | ||
|
||
oauth0050: ## create app with invalid auth | ||
command: ../clace app create --auth-type=abc --approve /oauth2 ./disk_usage | ||
stderr: "error: invalid authentication type abc" | ||
exit-code: 1 | ||
|
||
oauth0060: ## create app with invalid auth | ||
command: ../clace app create --auth-type=github_abc --approve /oauth2 ./disk_usage | ||
stderr: "error: invalid authentication type github_abc" | ||
exit-code: 1 | ||
|
||
oauth0070: # update app to invalid | ||
command: ../clace app update auth-type /oauth1 abc | ||
stderr: "error: invalid authentication type abc" | ||
exit-code: 1 | ||
|
||
oauth9999: # cleanup | ||
command: rm -rf ./disk_usage || true |