Skip to content

Commit

Permalink
rename LoginParams to SpoofLoginBody for client gen reasons (#1183)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo authored Jun 9, 2022
1 parent a05fa49 commit 215491b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions nexus/src/external_api/console_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use std::{collections::HashSet, ffi::OsString, path::PathBuf, sync::Arc};
use uuid::Uuid;

#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)]
pub struct LoginParams {
pub struct SpoofLoginBody {
pub username: String,
}

Expand All @@ -53,7 +53,7 @@ pub struct LoginParams {
}]
pub async fn spoof_login(
rqctx: Arc<RequestContext<Arc<ServerContext>>>,
params: TypedBody<LoginParams>,
params: TypedBody<SpoofLoginBody>,
) -> Result<Response<Body>, HttpError> {
let apictx = rqctx.context();
let nexus = &apictx.nexus;
Expand Down
4 changes: 2 additions & 2 deletions nexus/tests/integration_tests/console_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use nexus_test_utils_macros::nexus_test;
use omicron_common::api::external::IdentityMetadataCreateParams;
use omicron_nexus::authn::{USER_TEST_PRIVILEGED, USER_TEST_UNPRIVILEGED};
use omicron_nexus::db::identity::Asset;
use omicron_nexus::external_api::console_api::LoginParams;
use omicron_nexus::external_api::console_api::SpoofLoginBody;
use omicron_nexus::external_api::params::OrganizationCreate;
use omicron_nexus::external_api::views;

Expand Down Expand Up @@ -282,7 +282,7 @@ fn get_header_value(resp: TestResponse, header_name: HeaderName) -> String {

async fn log_in_and_extract_token(testctx: &ClientTestContext) -> String {
let login = RequestBuilder::new(&testctx, Method::POST, "/login")
.body(Some(&LoginParams { username: "privileged".to_string() }))
.body(Some(&SpoofLoginBody { username: "privileged".to_string() }))
.expect_status(Some(StatusCode::OK))
.execute()
.await
Expand Down
24 changes: 12 additions & 12 deletions openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LoginParams"
"$ref": "#/components/schemas/SpoofLoginBody"
}
}
},
Expand Down Expand Up @@ -6856,17 +6856,6 @@
"minLength": 1,
"maxLength": 11
},
"LoginParams": {
"type": "object",
"properties": {
"username": {
"type": "string"
}
},
"required": [
"username"
]
},
"MacAddr": {
"example": "ff:ff:ff:ff:ff:ff",
"title": "A MAC address",
Expand Down Expand Up @@ -8358,6 +8347,17 @@
"items"
]
},
"SpoofLoginBody": {
"type": "object",
"properties": {
"username": {
"type": "string"
}
},
"required": [
"username"
]
},
"SshKey": {
"description": "Client view of a [`SshKey`]",
"type": "object",
Expand Down

0 comments on commit 215491b

Please sign in to comment.