Skip to content

Commit 7fa6757

Browse files
committed
/me/device-tokens -> /me/access-tokens
1 parent 1436347 commit 7fa6757

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

nexus/external-api/output/nexus_tags.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ ping GET /v1/ping
289289

290290
API operations found with tag "tokens"
291291
OPERATION ID METHOD URL PATH
292-
current_user_device_token_delete DELETE /v1/me/device-tokens/{token_id}
293-
current_user_device_token_list GET /v1/me/device-tokens
292+
current_user_access_token_delete DELETE /v1/me/access-tokens/{token_id}
293+
current_user_access_token_list GET /v1/me/access-tokens
294294

295295
API operations found with tag "vpcs"
296296
OPERATION ID METHOD URL PATH

nexus/external-api/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3152,28 +3152,28 @@ pub trait NexusExternalApi {
31523152
path_params: Path<params::SshKeyPath>,
31533153
) -> Result<HttpResponseDeleted, HttpError>;
31543154

3155-
/// List device tokens
3155+
/// List access tokens
31563156
///
31573157
/// List device access tokens for the currently authenticated user.
31583158
#[endpoint {
31593159
method = GET,
3160-
path = "/v1/me/device-tokens",
3160+
path = "/v1/me/access-tokens",
31613161
tags = ["tokens"],
31623162
}]
3163-
async fn current_user_device_token_list(
3163+
async fn current_user_access_token_list(
31643164
rqctx: RequestContext<Self::Context>,
31653165
query_params: Query<PaginatedById>,
31663166
) -> Result<HttpResponseOk<ResultsPage<views::DeviceAccessToken>>, HttpError>;
31673167

3168-
/// Delete device token
3168+
/// Delete access token
31693169
///
31703170
/// Delete a device access token for the currently authenticated user.
31713171
#[endpoint {
31723172
method = DELETE,
3173-
path = "/v1/me/device-tokens/{token_id}",
3173+
path = "/v1/me/access-tokens/{token_id}",
31743174
tags = ["tokens"],
31753175
}]
3176-
async fn current_user_device_token_delete(
3176+
async fn current_user_access_token_delete(
31773177
rqctx: RequestContext<Self::Context>,
31783178
path_params: Path<params::TokenPath>,
31793179
) -> Result<HttpResponseDeleted, HttpError>;

nexus/src/external_api/http_entrypoints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7066,7 +7066,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
70667066
.await
70677067
}
70687068

7069-
async fn current_user_device_token_list(
7069+
async fn current_user_access_token_list(
70707070
rqctx: RequestContext<Self::Context>,
70717071
query_params: Query<PaginatedById>,
70727072
) -> Result<HttpResponseOk<ResultsPage<views::DeviceAccessToken>>, HttpError>
@@ -7097,7 +7097,7 @@ impl NexusExternalApi for NexusExternalApiImpl {
70977097
.await
70987098
}
70997099

7100-
async fn current_user_device_token_delete(
7100+
async fn current_user_access_token_delete(
71017101
rqctx: RequestContext<Self::Context>,
71027102
path_params: Path<params::TokenPath>,
71037103
) -> Result<HttpResponseDeleted, HttpError> {

nexus/tests/integration_tests/device_auth.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ async fn test_device_auth_flow(cptestctx: &ControlPlaneTestContext) {
202202
let token_id = tokens_unpriv_after[0].id;
203203

204204
// Priv user cannot delete unpriv's token through this endpoint by ID
205-
let token_url = format!("/v1/me/device-tokens/{}", token_id);
205+
let token_url = format!("/v1/me/access-tokens/{}", token_id);
206206
object_delete_error(testctx, &token_url, StatusCode::NOT_FOUND).await;
207207

208208
// Test deleting the token as the owner
@@ -424,7 +424,7 @@ async fn test_device_token_expiration(cptestctx: &ControlPlaneTestContext) {
424424
async fn get_tokens_priv(
425425
testctx: &ClientTestContext,
426426
) -> Vec<views::DeviceAccessToken> {
427-
NexusRequest::object_get(testctx, "/v1/me/device-tokens")
427+
NexusRequest::object_get(testctx, "/v1/me/access-tokens")
428428
.authn_as(AuthnMode::PrivilegedUser)
429429
.execute_and_parse_unwrap::<ResultsPage<views::DeviceAccessToken>>()
430430
.await
@@ -434,7 +434,7 @@ async fn get_tokens_priv(
434434
async fn get_tokens_unpriv(
435435
testctx: &ClientTestContext,
436436
) -> Vec<views::DeviceAccessToken> {
437-
NexusRequest::object_get(testctx, "/v1/me/device-tokens")
437+
NexusRequest::object_get(testctx, "/v1/me/access-tokens")
438438
.authn_as(AuthnMode::UnprivilegedUser)
439439
.execute_and_parse_unwrap::<ResultsPage<views::DeviceAccessToken>>()
440440
.await

nexus/tests/integration_tests/endpoints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2599,7 +2599,7 @@ pub static VERIFY_ENDPOINTS: LazyLock<Vec<VerifyEndpoint>> =
25992599
},
26002600
/* Tokens */
26012601
VerifyEndpoint {
2602-
url: "/v1/me/device-tokens",
2602+
url: "/v1/me/access-tokens",
26032603
visibility: Visibility::Public,
26042604
unprivileged_access: UnprivilegedAccess::ReadOnly,
26052605
allowed_methods: vec![AllowedMethod::Get],
@@ -2610,7 +2610,7 @@ pub static VERIFY_ENDPOINTS: LazyLock<Vec<VerifyEndpoint>> =
26102610
// and opt out.
26112611

26122612
// VerifyEndpoint {
2613-
// url: "/v1/me/device-tokens/token-id",
2613+
// url: "/v1/me/access-tokens/token-id",
26142614
// visibility: Visibility::Public,
26152615
// unprivileged_access: UnprivilegedAccess::None,
26162616
// allowed_methods: vec![AllowedMethod::Delete],

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
API endpoints with no coverage in authz tests:
22
probe_delete (delete "/experimental/v1/probes/{probe}")
3-
current_user_device_token_delete (delete "/v1/me/device-tokens/{token_id}")
3+
current_user_access_token_delete (delete "/v1/me/access-tokens/{token_id}")
44
probe_list (get "/experimental/v1/probes")
55
probe_view (get "/experimental/v1/probes/{probe}")
66
support_bundle_download (get "/experimental/v1/system/support-bundles/{bundle_id}/download")

openapi/nexus.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5512,14 +5512,14 @@
55125512
}
55135513
}
55145514
},
5515-
"/v1/me/device-tokens": {
5515+
"/v1/me/access-tokens": {
55165516
"get": {
55175517
"tags": [
55185518
"tokens"
55195519
],
5520-
"summary": "List device tokens",
5520+
"summary": "List access tokens",
55215521
"description": "List device access tokens for the currently authenticated user.",
5522-
"operationId": "current_user_device_token_list",
5522+
"operationId": "current_user_access_token_list",
55235523
"parameters": [
55245524
{
55255525
"in": "query",
@@ -5572,14 +5572,14 @@
55725572
}
55735573
}
55745574
},
5575-
"/v1/me/device-tokens/{token_id}": {
5575+
"/v1/me/access-tokens/{token_id}": {
55765576
"delete": {
55775577
"tags": [
55785578
"tokens"
55795579
],
5580-
"summary": "Delete device token",
5580+
"summary": "Delete access token",
55815581
"description": "Delete a device access token for the currently authenticated user.",
5582-
"operationId": "current_user_device_token_delete",
5582+
"operationId": "current_user_access_token_delete",
55835583
"parameters": [
55845584
{
55855585
"in": "path",

0 commit comments

Comments
 (0)