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

[refactor] drop unused whoami path and drop redundant endpoints info #358

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 0 additions & 24 deletions console-backend/api/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -360,30 +360,6 @@ paths:
# ## Admin
#

/api/admin/v1alpha1/user/whoami:
get:
tags:
- User administration
description: Get information about the current user.
responses:
200:
description: Information about the current user.
content:
'application/json':
schema:
type: object
properties:
id:
type: string
description: |
The ID of the current user.

NOTE: This ID may be different to the name of the user.
required:
- id
403:
description: In case the user is not logged in.

/api/admin/v1alpha1/apps/{application}/transfer-ownership:
parameters:
- $ref: '#/components/parameters/ApplicationName'
Expand Down
9 changes: 0 additions & 9 deletions console-backend/src/admin.rs

This file was deleted.

8 changes: 2 additions & 6 deletions console-backend/src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ impl DemoFetcher {
}
}

pub async fn get_info(
#[get("/drogue-endpoints")]
pub async fn get_public_endpoints(
endpoints: web::Data<Endpoints>,
demos: web::Data<DemoFetcher>,
) -> impl Responder {
Expand All @@ -32,11 +33,6 @@ pub async fn get_info(
HttpResponse::Ok().json(info)
}

#[get("/drogue-endpoints")]
pub async fn get_public_endpoints(endpoints: web::Data<Endpoints>) -> impl Responder {
HttpResponse::Ok().json(endpoints)
}

#[get("/drogue-version")]
pub async fn get_drogue_version() -> impl Responder {
HttpResponse::Ok().json(json!({
Expand Down
13 changes: 0 additions & 13 deletions console-backend/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mod admin;
mod api;
mod demos;
mod info;
Expand Down Expand Up @@ -222,19 +221,7 @@ pub async fn configurator(
>),
)),
)
.service(
web::scope("/api/admin/v1alpha1")
.wrap(auth.clone())
.service(web::resource("/user/whoami").route(web::get().to(admin::whoami))),
)
// everything from here on is unauthenticated or not using the middleware
.service(
web::scope("/api/console/v1alpha1").service(
web::resource("/info")
.wrap(auth)
.route(web::get().to(info::get_info)),
),
)
.service(index)
.service(
web::scope("/.well-known")
Expand Down