Knossos Oauth 2 Flow Changes (#752)

* adjust type and response format

* Replace Found with Ok for handled redirects

* scope parse fix

* change apps query from body to query

* adjust tests for new response type

* remove unused imports

* Clippy fixes
This commit is contained in:
Carter
2023-11-11 09:42:01 -08:00
committed by GitHub
parent a818199b5a
commit 97ccb7df94
7 changed files with 50 additions and 29 deletions

View File

@@ -42,7 +42,7 @@ async fn oauth_flow_happy_path() {
// Accept the authorization request
let resp = env.v3.oauth_accept(&flow_id, FRIEND_USER_PAT).await;
assert_status(&resp, StatusCode::FOUND);
assert_status(&resp, StatusCode::OK);
let query = get_redirect_location_query_params(&resp);
let auth_code = query.get("code").unwrap();
@@ -105,7 +105,7 @@ async fn oauth_authorize_for_already_authorized_scopes_returns_auth_code() {
USER_USER_PAT,
)
.await;
assert_status(&resp, StatusCode::FOUND);
assert_status(&resp, StatusCode::OK);
})
.await;
}
@@ -231,10 +231,10 @@ async fn reject_authorize_ends_authorize_flow() {
let flow_id = get_authorize_accept_flow_id(resp).await;
let resp = env.v3.oauth_reject(&flow_id, USER_USER_PAT).await;
assert_status(&resp, StatusCode::FOUND);
assert_status(&resp, StatusCode::OK);
let resp = env.v3.oauth_accept(&flow_id, USER_USER_PAT).await;
assert_any_status_except(&resp, StatusCode::FOUND);
assert_any_status_except(&resp, StatusCode::OK);
})
.await;
}
@@ -249,7 +249,7 @@ async fn accept_authorize_after_already_accepting_fails() {
.await;
let flow_id = get_authorize_accept_flow_id(resp).await;
let resp = env.v3.oauth_accept(&flow_id, USER_USER_PAT).await;
assert_status(&resp, StatusCode::FOUND);
assert_status(&resp, StatusCode::OK);
let resp = env.v3.oauth_accept(&flow_id, USER_USER_PAT).await;
assert_status(&resp, StatusCode::BAD_REQUEST);