You've already forked AstralRinth
forked from didirus/AstralRinth
V2 removal and _internal rerouting (#770)
* deleteed v3 exclusive routes * moved routes around * fixed linkage that movement broke * initial merge errors * fixes
This commit is contained in:
@@ -41,7 +41,7 @@ impl Api for ApiV3 {
|
||||
|
||||
async fn reset_search_index(&self) -> ServiceResponse {
|
||||
let req = actix_web::test::TestRequest::post()
|
||||
.uri("/v3/admin/_force_reindex")
|
||||
.uri("/_internal/admin/_force_reindex")
|
||||
.append_header((
|
||||
"Modrinth-Admin",
|
||||
dotenvy::var("LABRINTH_ADMIN_KEY").unwrap(),
|
||||
|
||||
@@ -55,7 +55,7 @@ impl ApiV3 {
|
||||
pub async fn oauth_accept(&self, flow: &str, pat: &str) -> ServiceResponse {
|
||||
self.call(
|
||||
TestRequest::post()
|
||||
.uri("/v3/oauth/accept")
|
||||
.uri("/_internal/oauth/accept")
|
||||
.append_header((AUTHORIZATION, pat))
|
||||
.set_json(RespondToOAuthClientScopes {
|
||||
flow: flow.to_string(),
|
||||
@@ -68,7 +68,7 @@ impl ApiV3 {
|
||||
pub async fn oauth_reject(&self, flow: &str, pat: &str) -> ServiceResponse {
|
||||
self.call(
|
||||
TestRequest::post()
|
||||
.uri("/v3/oauth/reject")
|
||||
.uri("/_internal/oauth/reject")
|
||||
.append_header((AUTHORIZATION, pat))
|
||||
.set_json(RespondToOAuthClientScopes {
|
||||
flow: flow.to_string(),
|
||||
@@ -87,7 +87,7 @@ impl ApiV3 {
|
||||
) -> ServiceResponse {
|
||||
self.call(
|
||||
TestRequest::post()
|
||||
.uri("/v3/oauth/token")
|
||||
.uri("/_internal/oauth/token")
|
||||
.append_header((AUTHORIZATION, client_secret))
|
||||
.set_form(TokenRequest {
|
||||
grant_type: "authorization_code".to_string(),
|
||||
@@ -108,7 +108,7 @@ pub fn generate_authorize_uri(
|
||||
state: Option<&str>,
|
||||
) -> String {
|
||||
format!(
|
||||
"/v3/oauth/authorize?client_id={}{}{}{}",
|
||||
"/_internal/oauth/authorize?client_id={}{}{}{}",
|
||||
urlencoding::encode(client_id),
|
||||
optional_query_param("redirect_uri", redirect_uri),
|
||||
optional_query_param("scope", scope),
|
||||
|
||||
@@ -27,7 +27,7 @@ impl ApiV3 {
|
||||
) -> ServiceResponse {
|
||||
let max_scopes = max_scopes.bits();
|
||||
let req = TestRequest::post()
|
||||
.uri("/v3/oauth/app")
|
||||
.uri("/_internal/oauth/app")
|
||||
.append_header((AUTHORIZATION, pat))
|
||||
.set_json(json!({
|
||||
"name": name,
|
||||
@@ -52,7 +52,7 @@ impl ApiV3 {
|
||||
|
||||
pub async fn get_oauth_client(&self, client_id: String, pat: &str) -> ServiceResponse {
|
||||
let req = TestRequest::get()
|
||||
.uri(&format!("/v3/oauth/app/{}", client_id))
|
||||
.uri(&format!("/_internal/oauth/app/{}", client_id))
|
||||
.append_header((AUTHORIZATION, pat))
|
||||
.to_request();
|
||||
|
||||
@@ -66,7 +66,10 @@ impl ApiV3 {
|
||||
pat: &str,
|
||||
) -> ServiceResponse {
|
||||
let req = TestRequest::patch()
|
||||
.uri(&format!("/v3/oauth/app/{}", urlencoding::encode(client_id)))
|
||||
.uri(&format!(
|
||||
"/_internal/oauth/app/{}",
|
||||
urlencoding::encode(client_id)
|
||||
))
|
||||
.set_json(edit)
|
||||
.append_header((AUTHORIZATION, pat))
|
||||
.to_request();
|
||||
@@ -76,7 +79,7 @@ impl ApiV3 {
|
||||
|
||||
pub async fn delete_oauth_client(&self, client_id: &str, pat: &str) -> ServiceResponse {
|
||||
let req = TestRequest::delete()
|
||||
.uri(&format!("/v3/oauth/app/{}", client_id))
|
||||
.uri(&format!("/_internal/oauth/app/{}", client_id))
|
||||
.append_header((AUTHORIZATION, pat))
|
||||
.to_request();
|
||||
|
||||
@@ -86,7 +89,7 @@ impl ApiV3 {
|
||||
pub async fn revoke_oauth_authorization(&self, client_id: &str, pat: &str) -> ServiceResponse {
|
||||
let req = TestRequest::delete()
|
||||
.uri(&format!(
|
||||
"/v3/oauth/authorizations?client_id={}",
|
||||
"/_internal/oauth/authorizations?client_id={}",
|
||||
urlencoding::encode(client_id)
|
||||
))
|
||||
.append_header((AUTHORIZATION, pat))
|
||||
@@ -96,7 +99,7 @@ impl ApiV3 {
|
||||
|
||||
pub async fn get_user_oauth_authorizations(&self, pat: &str) -> Vec<OAuthClientAuthorization> {
|
||||
let req = TestRequest::get()
|
||||
.uri("/v3/oauth/authorizations")
|
||||
.uri("/_internal/oauth/authorizations")
|
||||
.append_header((AUTHORIZATION, pat))
|
||||
.to_request();
|
||||
let resp = self.call(req).await;
|
||||
|
||||
Reference in New Issue
Block a user