Skip to content

Commit

Permalink
[refactor] drop unused whoami path and drop redundant endpoints info …
Browse files Browse the repository at this point in the history
…resources
  • Loading branch information
jbtrystram committed Nov 23, 2022
1 parent 89ac45e commit 699dd20
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 52 deletions.
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

0 comments on commit 699dd20

Please sign in to comment.