Skip to content

Commit 21f891a

Browse files
committed
chore(microsoft_ad): inline the public password-method route segment
The password authentication method id is a fixed, publicly documented Graph route segment identical for every user in every tenant, but exporting it as PASSWORD_..._ID = '<uuid>' matches generic secret-scanner heuristics. It has a single call site, so inline it there with a doc reference instead.
1 parent d4eb047 commit 21f891a

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

apps/sim/tools/microsoft_ad/reset_password.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@ import type {
22
MicrosoftAdResetPasswordParams,
33
MicrosoftAdResetPasswordResponse,
44
} from '@/tools/microsoft_ad/types'
5-
import { PASSWORD_AUTHENTICATION_METHOD_ID } from '@/tools/microsoft_ad/utils'
65
import type { ToolConfig } from '@/tools/types'
76

7+
/**
8+
* Microsoft Graph exposes a user's password authentication method under a fixed, publicly
9+
* documented object id that is identical for every user in every tenant. It is a route
10+
* segment, not a credential.
11+
*
12+
* @see https://learn.microsoft.com/en-us/graph/api/resources/passwordauthenticationmethod
13+
*/
14+
const PASSWORD_METHOD_ROUTE_SEGMENT = '28c10230-6103-485e-b985-444c60001490'
15+
816
export const resetPasswordTool: ToolConfig<
917
MicrosoftAdResetPasswordParams,
1018
MicrosoftAdResetPasswordResponse
@@ -44,7 +52,7 @@ export const resetPasswordTool: ToolConfig<
4452
url: (params) => {
4553
const userId = params.userId?.trim()
4654
if (!userId) throw new Error('User ID is required')
47-
return `https://graph.microsoft.com/v1.0/users/${encodeURIComponent(userId)}/authentication/methods/${PASSWORD_AUTHENTICATION_METHOD_ID}/resetPassword`
55+
return `https://graph.microsoft.com/v1.0/users/${encodeURIComponent(userId)}/authentication/methods/${PASSWORD_METHOD_ROUTE_SEGMENT}/resetPassword`
4856
},
4957
method: 'POST',
5058
headers: (params) => ({

apps/sim/tools/microsoft_ad/utils.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ export function buildGraphCollectionUrl(
5353
: `https://graph.microsoft.com/v1.0/${path}`
5454
}
5555

56-
/**
57-
* The well-known identifier of a user's password authentication method. Microsoft Graph
58-
* documents this ID as constant for every user.
59-
*/
60-
export const PASSWORD_AUTHENTICATION_METHOD_ID = '28c10230-6103-485e-b985-444c60001490'
61-
6256
/** The `device` properties the Microsoft Entra ID tools project into their outputs. */
6357
export const DEVICE_SELECT =
6458
'id,deviceId,displayName,operatingSystem,operatingSystemVersion,accountEnabled,isCompliant,isManaged,trustType,profileType,manufacturer,model,approximateLastSignInDateTime,registrationDateTime'

0 commit comments

Comments
 (0)