Skip to content

Commit 7d5d83c

Browse files
authored
[nexus] Conventionalize operation names on scim token endpoints (#9171)
I failed to catch that the endpoints had unconventional names on #9070, but noticed it immediately when looking at pulling it into the console.
1 parent a3ee742 commit 7d5d83c

File tree

5 files changed

+52
-25
lines changed

5 files changed

+52
-25
lines changed

nexus/external-api/output/nexus_tags.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,11 @@ local_idp_user_delete DELETE /v1/system/identity-providers/
272272
local_idp_user_set_password POST /v1/system/identity-providers/local/users/{user_id}/set-password
273273
saml_identity_provider_create POST /v1/system/identity-providers/saml
274274
saml_identity_provider_view GET /v1/system/identity-providers/saml/{provider}
275-
scim_idp_create_token POST /v1/system/scim/tokens
276-
scim_idp_delete_all_tokens DELETE /v1/system/scim/tokens
277-
scim_idp_delete_token_by_id DELETE /v1/system/scim/tokens/{token_id}
278-
scim_idp_get_token_by_id GET /v1/system/scim/tokens/{token_id}
279-
scim_idp_get_tokens GET /v1/system/scim/tokens
275+
scim_token_create POST /v1/system/scim/tokens
276+
scim_token_delete DELETE /v1/system/scim/tokens/{token_id}
277+
scim_token_delete_all DELETE /v1/system/scim/tokens
278+
scim_token_list GET /v1/system/scim/tokens
279+
scim_token_view GET /v1/system/scim/tokens/{token_id}
280280
silo_create POST /v1/system/silos
281281
silo_delete DELETE /v1/system/silos/{silo}
282282
silo_identity_provider_list GET /v1/system/identity-providers

nexus/external-api/src/lib.rs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -594,54 +594,71 @@ pub trait NexusExternalApi {
594594

595595
// SAML+SCIM Identity Provider
596596

597+
/// List SCIM tokens
598+
///
599+
/// Specify the silo by name or ID using the `silo` query parameter.
597600
#[endpoint {
598601
method = GET,
599602
path = "/v1/system/scim/tokens",
600603
tags = ["system/silos"],
601604
}]
602-
async fn scim_idp_get_tokens(
605+
async fn scim_token_list(
603606
rqctx: RequestContext<Self::Context>,
604607
query_params: Query<params::SiloSelector>,
605608
) -> Result<HttpResponseOk<Vec<views::ScimClientBearerToken>>, HttpError>;
606609

610+
/// Create SCIM token
611+
///
612+
/// Specify the silo by name or ID using the `silo` query parameter. Be sure
613+
/// to save the bearer token in the response. It will not be retrievable
614+
/// later through the token view and list endpoints.
607615
#[endpoint {
608616
method = POST,
609617
path = "/v1/system/scim/tokens",
610618
tags = ["system/silos"],
611619
}]
612-
async fn scim_idp_create_token(
620+
async fn scim_token_create(
613621
rqctx: RequestContext<Self::Context>,
614622
query_params: Query<params::SiloSelector>,
615623
) -> Result<HttpResponseCreated<views::ScimClientBearerTokenValue>, HttpError>;
616624

625+
/// Fetch SCIM token
626+
///
627+
/// Specify the silo by name or ID using the `silo` query parameter.
617628
#[endpoint {
618629
method = GET,
619630
path = "/v1/system/scim/tokens/{token_id}",
620631
tags = ["system/silos"],
621632
}]
622-
async fn scim_idp_get_token_by_id(
633+
async fn scim_token_view(
623634
rqctx: RequestContext<Self::Context>,
624635
path_params: Path<params::ScimV2TokenPathParam>,
625636
query_params: Query<params::SiloSelector>,
626637
) -> Result<HttpResponseOk<views::ScimClientBearerToken>, HttpError>;
627638

639+
/// Delete SCIM token
640+
///
641+
/// Specify the silo by name or ID using the `silo` query parameter.
628642
#[endpoint {
629643
method = DELETE,
630644
path = "/v1/system/scim/tokens/{token_id}",
631645
tags = ["system/silos"],
632646
}]
633-
async fn scim_idp_delete_token_by_id(
647+
async fn scim_token_delete(
634648
rqctx: RequestContext<Self::Context>,
635649
path_params: Path<params::ScimV2TokenPathParam>,
636650
query_params: Query<params::SiloSelector>,
637651
) -> Result<HttpResponseDeleted, HttpError>;
638652

653+
/// Delete all SCIM tokens
654+
///
655+
/// Specify the silo by name or ID using the `silo` query parameter.
639656
#[endpoint {
640657
method = DELETE,
641658
path = "/v1/system/scim/tokens",
642659
tags = ["system/silos"],
643660
}]
644-
async fn scim_idp_delete_all_tokens(
661+
async fn scim_token_delete_all(
645662
rqctx: RequestContext<Self::Context>,
646663
query_params: Query<params::SiloSelector>,
647664
) -> Result<HttpResponseDeleted, HttpError>;

nexus/src/external_api/http_entrypoints.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
883883
.await
884884
}
885885

886-
async fn scim_idp_get_tokens(
886+
async fn scim_token_list(
887887
rqctx: RequestContext<Self::Context>,
888888
query_params: Query<params::SiloSelector>,
889889
) -> Result<HttpResponseOk<Vec<views::ScimClientBearerToken>>, HttpError>
@@ -917,7 +917,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
917917
.await
918918
}
919919

920-
async fn scim_idp_create_token(
920+
async fn scim_token_create(
921921
rqctx: RequestContext<Self::Context>,
922922
query_params: Query<params::SiloSelector>,
923923
) -> Result<HttpResponseCreated<views::ScimClientBearerTokenValue>, HttpError>
@@ -951,7 +951,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
951951
.await
952952
}
953953

954-
async fn scim_idp_get_token_by_id(
954+
async fn scim_token_view(
955955
rqctx: RequestContext<Self::Context>,
956956
path_params: Path<params::ScimV2TokenPathParam>,
957957
query_params: Query<params::SiloSelector>,
@@ -991,7 +991,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
991991
.await
992992
}
993993

994-
async fn scim_idp_delete_token_by_id(
994+
async fn scim_token_delete(
995995
rqctx: RequestContext<Self::Context>,
996996
path_params: Path<params::ScimV2TokenPathParam>,
997997
query_params: Query<params::SiloSelector>,
@@ -1031,7 +1031,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
10311031
.await
10321032
}
10331033

1034-
async fn scim_idp_delete_all_tokens(
1034+
async fn scim_token_delete_all(
10351035
rqctx: RequestContext<Self::Context>,
10361036
query_params: Query<params::SiloSelector>,
10371037
) -> Result<HttpResponseDeleted, HttpError> {

nexus/tests/output/uncovered-authz-endpoints.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
API endpoints with no coverage in authz tests:
22
probe_delete (delete "/experimental/v1/probes/{probe}")
33
current_user_access_token_delete (delete "/v1/me/access-tokens/{token_id}")
4-
scim_idp_delete_all_tokens (delete "/v1/system/scim/tokens")
5-
scim_idp_delete_token_by_id (delete "/v1/system/scim/tokens/{token_id}")
4+
scim_token_delete_all (delete "/v1/system/scim/tokens")
5+
scim_token_delete (delete "/v1/system/scim/tokens/{token_id}")
66
probe_list (get "/experimental/v1/probes")
77
probe_view (get "/experimental/v1/probes/{probe}")
88
support_bundle_download (get "/experimental/v1/system/support-bundles/{bundle_id}/download")
@@ -12,8 +12,8 @@ ping (get "/v1/ping")
1212
networking_switch_port_lldp_neighbors (get "/v1/system/hardware/rack-switch-port/{rack_id}/{switch_location}/{port}/lldp/neighbors")
1313
networking_switch_port_lldp_config_view (get "/v1/system/hardware/switch-port/{port}/lldp/config")
1414
networking_switch_port_status (get "/v1/system/hardware/switch-port/{port}/status")
15-
scim_idp_get_tokens (get "/v1/system/scim/tokens")
16-
scim_idp_get_token_by_id (get "/v1/system/scim/tokens/{token_id}")
15+
scim_token_list (get "/v1/system/scim/tokens")
16+
scim_token_view (get "/v1/system/scim/tokens/{token_id}")
1717
support_bundle_head (head "/experimental/v1/system/support-bundles/{bundle_id}/download")
1818
support_bundle_head_file (head "/experimental/v1/system/support-bundles/{bundle_id}/download/{file}")
1919
device_auth_request (post "/device/auth")
@@ -25,4 +25,4 @@ alert_delivery_resend (post "/v1/alerts/{alert_id}/resend")
2525
login_local (post "/v1/login/{silo_name}/local")
2626
logout (post "/v1/logout")
2727
networking_switch_port_lldp_config_update (post "/v1/system/hardware/switch-port/{port}/lldp/config")
28-
scim_idp_create_token (post "/v1/system/scim/tokens")
28+
scim_token_create (post "/v1/system/scim/tokens")

openapi/nexus.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10357,7 +10357,9 @@
1035710357
"tags": [
1035810358
"system/silos"
1035910359
],
10360-
"operationId": "scim_idp_get_tokens",
10360+
"summary": "List SCIM tokens",
10361+
"description": "Specify the silo by name or ID using the `silo` query parameter.",
10362+
"operationId": "scim_token_list",
1036110363
"parameters": [
1036210364
{
1036310365
"in": "query",
@@ -10396,7 +10398,9 @@
1039610398
"tags": [
1039710399
"system/silos"
1039810400
],
10399-
"operationId": "scim_idp_create_token",
10401+
"summary": "Create SCIM token",
10402+
"description": "Specify the silo by name or ID using the `silo` query parameter. Be sure to save the bearer token in the response. It will not be retrievable later through the token view and list endpoints.",
10403+
"operationId": "scim_token_create",
1040010404
"parameters": [
1040110405
{
1040210406
"in": "query",
@@ -10431,7 +10435,9 @@
1043110435
"tags": [
1043210436
"system/silos"
1043310437
],
10434-
"operationId": "scim_idp_delete_all_tokens",
10438+
"summary": "Delete all SCIM tokens",
10439+
"description": "Specify the silo by name or ID using the `silo` query parameter.",
10440+
"operationId": "scim_token_delete_all",
1043510441
"parameters": [
1043610442
{
1043710443
"in": "query",
@@ -10461,7 +10467,9 @@
1046110467
"tags": [
1046210468
"system/silos"
1046310469
],
10464-
"operationId": "scim_idp_get_token_by_id",
10470+
"summary": "Fetch SCIM token",
10471+
"description": "Specify the silo by name or ID using the `silo` query parameter.",
10472+
"operationId": "scim_token_view",
1046510473
"parameters": [
1046610474
{
1046710475
"in": "path",
@@ -10505,7 +10513,9 @@
1050510513
"tags": [
1050610514
"system/silos"
1050710515
],
10508-
"operationId": "scim_idp_delete_token_by_id",
10516+
"summary": "Delete SCIM token",
10517+
"description": "Specify the silo by name or ID using the `silo` query parameter.",
10518+
"operationId": "scim_token_delete",
1050910519
"parameters": [
1051010520
{
1051110521
"in": "path",

0 commit comments

Comments
 (0)