Skip to content

Commit 259da84

Browse files
[Identity] Remove inappropriate @internal tags from non-exported members (#36052)
## Problem The `@internal` JSDoc tag was being used inappropriately throughout the Identity packages. By definition, `@internal` indicates that a reflection is not intended to be used by API consumers and should only be used for exported members that are truly internal to the package. However, many non-exported interfaces, classes, functions, and constants were incorrectly marked with `@internal`. ## Solution This PR systematically removes inappropriate `@internal` tags from non-exported members across all Identity packages while preserving legitimate usage on exported members that are not re-exported in index.ts. ### Files Modified - **Main Identity Package (`@azure/identity`)**: - `src/credentials/defaultAzureCredential.ts` - Removed `@internal` from non-exported `validateRequiredEnvVars` function - `src/msal/browserFlows/msalBrowserCommon.ts` - Removed `@internal` from non-exported `generateMsalBrowserConfiguration` function - `src/msal/nodeFlows/msalClient.ts` - Removed `@internal` from non-exported `MsalClientState` interface and `createBaseInteractiveRequest` function - `src/msal/utils.ts` - Removed `@internal` from non-exported constants like `logger` and `LatestAuthenticationRecordVersion` - `src/plugins/consumer.ts` - Removed `@internal` from non-exported `pluginContext` constant - **Supporting Packages**: - `@azure/identity-broker` - Removed `@internal` from non-exported `AzurePluginContext` interface - `@azure/identity-cache-persistence` - Removed `@internal` from non-exported constants, types, and functions - `@azure/identity-vscode` - Removed `@internal` from non-exported `AzurePluginContext` interface ### Examples of Changes **Before:** ```typescript /** * @internal */ const logger = credentialLogger("IdentityUtils"); ``` **After:** ```typescript const logger = credentialLogger("IdentityUtils"); ``` ### What Remains The `@internal` tag is still appropriately used on exported members that are not re-exported in index.ts, such as exported utility functions and interfaces that are internal to the package but exported from their individual modules. ### Validation - ✅ All existing linting rules pass with no new errors - ✅ No security vulnerabilities introduced - ✅ Only legitimate `@internal` tags remain on exported members - ✅ 12 inappropriate usages removed from non-exported members across 8 files This change improves JSDoc consistency and ensures proper adherence to documentation standards by removing inappropriate `@internal` tags from non-exported members while maintaining backward compatibility. <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[Identity] Remove Incorrect Use of @internal</issue_title> > <issue_description>Remove inappropriate use of the `@internal` tag in JS Doc inside the `Identity` repo. By definition, `The @internal tag indicates that a reflection is not intended to be used by API consumers.` Any usage for `@internal` in JS Doc for non-exported member is inappropriate. Ensure exported member are either exported in index.ts or used in the test folder.</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> Fixes #36049 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click [here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start the survey. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: minhanh-phan <[email protected]>
1 parent d9c8393 commit 259da84

File tree

8 files changed

+1
-18
lines changed

8 files changed

+1
-18
lines changed

sdk/identity/identity-broker/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import { NativeBrokerPlugin } from "@azure/msal-node-extensions";
66

77
/**
88
* A subset of the AzurePluginContext provided by \@azure/identity
9-
*
10-
* @internal
119
*/
1210
interface AzurePluginContext {
1311
nativeBrokerPluginControl: NativeBrokerPluginControl;

sdk/identity/identity-cache-persistence/src/platforms.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import type { TokenCachePersistenceOptions } from "@azure/identity";
2020
* - Darwin: '/Users/user/'
2121
* - Windows 8+: 'C:\Users\user\AppData\Local'
2222
* - Linux: '/home/user/.local/share'
23-
* @internal
2423
*/
2524
const localApplicationDataFolder =
2625
process.env.APPDATA?.replace?.(/(.Roaming)*$/, "\\Local") ?? process.env.HOME!;
@@ -63,7 +62,6 @@ export type MsalPersistenceOptions = Omit<TokenCachePersistenceOptions, "enabled
6362

6463
/**
6564
* A function that returns a persistent token cache instance.
66-
* @internal
6765
*/
6866
type MsalPersistenceFactory = (options?: MsalPersistenceOptions) => Promise<Persistence>;
6967

@@ -72,7 +70,6 @@ type MsalPersistenceFactory = (options?: MsalPersistenceOptions) => Promise<Pers
7270
* - Darwin: '/Users/user/.IdentityService/<name>'
7371
* - Windows 8+: 'C:\Users\user\AppData\Local\.IdentityService\<name>'
7472
* - Linux: '/home/user/.IdentityService/<name>'
75-
* @internal
7673
*/
7774
function getPersistencePath(name: string): string {
7875
return path.join(defaultMsalValues.tokenCache.directory, name);

sdk/identity/identity-vscode/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ interface VSCodeCredentialControl {
2020
*
2121
* Plugin authors are responsible for casting their plugin context values
2222
* to this type.
23-
*
24-
* @internal
2523
*/
2624
interface AzurePluginContext {
2725
vsCodeCredentialControl: VSCodeCredentialControl;

sdk/identity/identity/src/credentials/defaultAzureCredential.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export class DefaultAzureCredential extends ChainedTokenCredential {
199199
}
200200

201201
/**
202-
* @internal This function checks that all environment variables in `options.requiredEnvVars` are set and non-empty.
202+
* This function checks that all environment variables in `options.requiredEnvVars` are set and non-empty.
203203
* If any are missing or empty, it throws an error.
204204
*/
205205
function validateRequiredEnvVars(options?: DefaultAzureCredentialOptions) {

sdk/identity/identity/src/msal/browserFlows/msalBrowserCommon.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const isLocationDefined = typeof self !== "undefined" && self.location !== undef
3434

3535
/**
3636
* Generates a MSAL configuration that generally works for browsers
37-
* @internal
3837
*/
3938
function generateMsalBrowserConfiguration(
4039
options: MsalBrowserFlowOptions,

sdk/identity/identity/src/msal/nodeFlows/msalClient.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,6 @@ export function generateMsalConfiguration(
315315
/**
316316
* Represents the state necessary for the MSAL (Microsoft Authentication Library) client to operate.
317317
* This includes the MSAL configuration, cached account information, Azure region, and a flag to disable automatic authentication.
318-
*
319-
* @internal
320318
*/
321319
interface MsalClientState {
322320
/** The configuration for the MSAL client. */
@@ -769,8 +767,6 @@ export function createMsalClient(
769767
/**
770768
* Creates a base interactive request configuration for MSAL interactive authentication.
771769
* This is shared between interactive and brokered authentication flows.
772-
*
773-
* @internal
774770
*/
775771
function createBaseInteractiveRequest(
776772
scopes: string[],

sdk/identity/identity/src/msal/utils.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,10 @@ export interface ILoggerCallback {
1717
(level: msalCommon.LogLevel, message: string, containsPii: boolean): void;
1818
}
1919

20-
/**
21-
* @internal
22-
*/
2320
const logger = credentialLogger("IdentityUtils");
2421

2522
/**
2623
* Latest AuthenticationRecord version
27-
* @internal
2824
*/
2925
const LatestAuthenticationRecordVersion = "1.0";
3026

sdk/identity/identity/src/plugins/consumer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
/**
1212
* The context passed to an Identity plugin. This contains objects that
1313
* plugins can use to set backend implementations.
14-
* @internal
1514
*/
1615
const pluginContext: AzurePluginContext = {
1716
cachePluginControl: msalNodeFlowCacheControl,

0 commit comments

Comments
 (0)