docs: clarify -BearerToken/-Token examples accept both "Bearer <token>" and raw token forms - #909
Open
pavankadabala-png wants to merge 11 commits into
Conversation
Member
|
@pavankadabala-png Not sure if you saw the comment on the issue: #666 (comment) |
Contributor
Author
|
Thanks @FH-Inway, no problem on the scope change — happy to take it on. Here's the plan:
Pushing the updated commits shortly. |
…let examples (d365collaborative#666) Per the d365collaborative#666 scope change: the public cmdlets normalize the token (StartsWith("Bearer ") guard), so both "Bearer <token>" and "<token>" are valid. Added a second .EXAMPLE demonstrating the "Bearer " form and noted in .PARAMETER that the prefix is optional and prepended automatically when missing.
d365collaborative#666) Per the d365collaborative#666 scope change: unlike the public cmdlets, these internal functions have no StartsWith("Bearer ") normalization and always require the token to include the "Bearer " prefix. Reverts their -Token/-BearerToken examples back to the "Bearer <token>" form.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the LCS cmdlet comment-based-help examples to reflect how the token parameters actually behave, per the revised scope of #666.
Background: the original issue reported that the
Bearerprefix in the-BearerToken/-Tokenexamples caused auth errors. On closer investigation (thanks @FH-Inway), the public LCS cmdlets normalize the token — aStartsWith("Bearer ")guard auto-prependsBearerwhen it's missing — so both"Bearer <token>"and"<token>"are valid and produce the same result.Public cmdlets (
Invoke-D365LcsUpload,Get-D365LcsDeploymentStatus,Invoke-D365LcsDeployment): rather than removing the prefix, the examples now show both forms are accepted. Each gets a second.EXAMPLEusing theBearer-prefixed token, and the.PARAMETER BearerTokendescription notes the prefix is optional and prepended automatically when missing.Internal functions (
Start-LcsUploadV2,Complete-LcsUploadV2,Get-LcsDeploymentStatusV2,Get-LcsEnvironmentHistory,Get-LcsEnvironmentMetadata,Start-LcsDeploymentV2): these have no normalization and always require the prefix, so their examples keep theBearer <token>form (restored to match the internal API contract). This leaves them identical tomaster, so they no longer appear in the diff.Consistency check: all 16 public LCS cmdlets that send a token to the API already carry the
StartsWith("Bearer ")guard. The only token-parameter cmdlet without it isSet-D365LcsApiConfig, which just stores the token in config and never calls the API, so it doesn't need normalization.Only
.EXAMPLE/.PARAMETERhelp text changed — no functional/normalization code was touched.Closes #666