Skip to content

Commit 215491b

Browse files
authored
rename LoginParams to SpoofLoginBody for client gen reasons (#1183)
1 parent a05fa49 commit 215491b

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

nexus/src/external_api/console_api.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use std::{collections::HashSet, ffi::OsString, path::PathBuf, sync::Arc};
3737
use uuid::Uuid;
3838

3939
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)]
40-
pub struct LoginParams {
40+
pub struct SpoofLoginBody {
4141
pub username: String,
4242
}
4343

@@ -53,7 +53,7 @@ pub struct LoginParams {
5353
}]
5454
pub async fn spoof_login(
5555
rqctx: Arc<RequestContext<Arc<ServerContext>>>,
56-
params: TypedBody<LoginParams>,
56+
params: TypedBody<SpoofLoginBody>,
5757
) -> Result<Response<Body>, HttpError> {
5858
let apictx = rqctx.context();
5959
let nexus = &apictx.nexus;

nexus/tests/integration_tests/console_api.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use nexus_test_utils_macros::nexus_test;
1717
use omicron_common::api::external::IdentityMetadataCreateParams;
1818
use omicron_nexus::authn::{USER_TEST_PRIVILEGED, USER_TEST_UNPRIVILEGED};
1919
use omicron_nexus::db::identity::Asset;
20-
use omicron_nexus::external_api::console_api::LoginParams;
20+
use omicron_nexus::external_api::console_api::SpoofLoginBody;
2121
use omicron_nexus::external_api::params::OrganizationCreate;
2222
use omicron_nexus::external_api::views;
2323

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

283283
async fn log_in_and_extract_token(testctx: &ClientTestContext) -> String {
284284
let login = RequestBuilder::new(&testctx, Method::POST, "/login")
285-
.body(Some(&LoginParams { username: "privileged".to_string() }))
285+
.body(Some(&SpoofLoginBody { username: "privileged".to_string() }))
286286
.expect_status(Some(StatusCode::OK))
287287
.execute()
288288
.await

openapi/nexus.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@
386386
"content": {
387387
"application/json": {
388388
"schema": {
389-
"$ref": "#/components/schemas/LoginParams"
389+
"$ref": "#/components/schemas/SpoofLoginBody"
390390
}
391391
}
392392
},
@@ -6856,17 +6856,6 @@
68566856
"minLength": 1,
68576857
"maxLength": 11
68586858
},
6859-
"LoginParams": {
6860-
"type": "object",
6861-
"properties": {
6862-
"username": {
6863-
"type": "string"
6864-
}
6865-
},
6866-
"required": [
6867-
"username"
6868-
]
6869-
},
68706859
"MacAddr": {
68716860
"example": "ff:ff:ff:ff:ff:ff",
68726861
"title": "A MAC address",
@@ -8358,6 +8347,17 @@
83588347
"items"
83598348
]
83608349
},
8350+
"SpoofLoginBody": {
8351+
"type": "object",
8352+
"properties": {
8353+
"username": {
8354+
"type": "string"
8355+
}
8356+
},
8357+
"required": [
8358+
"username"
8359+
]
8360+
},
83618361
"SshKey": {
83628362
"description": "Client view of a [`SshKey`]",
83638363
"type": "object",

0 commit comments

Comments
 (0)