feat: implement flat universal parameters for CUT-5149 custom attributes#746
feat: implement flat universal parameters for CUT-5149 custom attributes#746junioralmeida-82 wants to merge 6 commits into
Conversation
…e CSV and template functions
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
There are 4 total unresolved issues (including 1 from previous review).
Reviewed by Cursor Bugbot for commit 1f3e90c. Configure here.
gweinjc
left a comment
There was a problem hiding this comment.
Results:
Tested the changes locally, was able to add/remove/update custom attributes on devices.
To-Do:
- Docs for each of the changed functions need to be updated to include the new params and examples of how to use them. See the following script to generate the helpfiles: PowerShell/Deploy/Build-HelpFiles.ps1
- Missing tests for
Update-JCDeviceFromCsvandNew-JCDeviceUpdateTemplate - See other in-line comments
| [Alias('_id', 'id')] | ||
| $SystemID, | ||
|
|
||
| [Parameter(ValueFromPipelineByPropertyName = $true, HelpMessage = 'The system displayName. The displayName is set to the hostname of the system during agent installation. When the system hostname updates the displayName does not update.')] |
There was a problem hiding this comment.
Why did we remove all of the HelpMessages from the params?
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$allowMultiFactorAuthentication, | ||
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$allowPublicKeyAuthentication, | ||
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$systemInsights, | ||
| [Parameter(ValueFromPipelineByPropertyName = $false)]$primarySystemUser, |
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$allowSshRootLogin, | ||
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$allowMultiFactorAuthentication, | ||
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$allowPublicKeyAuthentication, | ||
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$systemInsights, |
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$allowSshPasswordAuthentication, | ||
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$allowSshRootLogin, | ||
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$allowMultiFactorAuthentication, | ||
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$allowPublicKeyAuthentication, |
| [Parameter(ValueFromPipelineByPropertyName = $true)][string]$description, | ||
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$allowSshPasswordAuthentication, | ||
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$allowSshRootLogin, | ||
| [Parameter(ValueFromPipelineByPropertyName = $true)][bool]$allowMultiFactorAuthentication, |
|
|
||
| begin { | ||
| DynamicParam { | ||
| # Inicializa o dicionário nativo para evitar falhas de compilação no macOS |
There was a problem hiding this comment.
May need to remove comments
| $dict.Add("Attribute$ParamNumber`_value", $param1) | ||
| } | ||
| } | ||
| # Sempre retorna o objeto (preenchido ou vazio), neutralizando o bug de binding do Mac |
There was a problem hiding this comment.
May need to remove comments
| $Force | ||
| $Force, | ||
|
|
||
| # CUT-5149: Universal parameter to define the number of custom attributes via CLI. |
There was a problem hiding this comment.
May need to remove comments
| elseif ($ConfirmPrimarySystemUser -eq 'N') { | ||
| } | ||
|
|
||
| # CUT-5149: Assistente interativo por perguntas para incluir colunas de Custom Attributes |
There was a problem hiding this comment.
May need to remove comments
| } | ||
| } | ||
|
|
||
| # Injection for CUT-5149: Dynamically calculates the number of Custom Attributes in the current line's CSV. |
There was a problem hiding this comment.
May need to remove comments

Issues
What does this solve?
ParameterSetNametags to resolve binding intersections.ParameterBindingExceptionby ensuring the method returns a validated object dictionary instead of a raw$nullwhen processing exclusions.Update-JCSystemFromCSVandNew-JCImportSystemTemplatefocused entirely on system infrastructure profiles rather than legacy user nomenclature.FunctionsToExportinsideJumpCloud.psd1.Is there anything particularly tricky?
Cmd+F) that all environment credentials, actual Org IDs, and API keys are completely stripped from the committed codebase files.How should this be tested?
Execute the official orchestrator targeting the task tag:
& "./Tests/InvokePester.ps1" -JumpCloudApiKey $ApiKey -IncludeTagList "CUT-5149"Screenshots
Note
Medium Risk
Changes a core cmdlet (Set-JCSystem) and live API PUT behavior for attributes; mistakes could overwrite or drop existing system custom attributes, though merge logic and tests mitigate this.
Overview
Bumps the JumpCloud module to 3.3.0 and extends system management with custom attributes (CUT-5149), aligned with the existing user attribute pattern (
NumberOfCustomAttributes+ dynamicAttributeN_name/AttributeN_value).Set-JCSystemgains flat parameters for add/update/remove of custom attributes: it loads current attributes viaGet-JCSystem, merges or removes by name, and sends the fullattributesarray on PUT. ADynamicParamblock exposesAttributeN_*whenNumberOfCustomAttributesis set, always returning a parameter dictionary (fixes macOS binding when no dynamic params are needed). The API URL now uses$global:JCUrlBasePath.New-JCDeviceUpdateTemplateacceptsNumberOfCustomAttributes(CLI or interactive) to addAttributeN_name/AttributeN_valuecolumns to device update CSVs.Update-JCDeviceFromCSVadds aliasUpdate-JCSystemFromCSV, counts populated attribute columns per row, and passesNumberOfCustomAttributesintoSet-JCSystem. New Pester coverage exercises add, merge, and selective remove of system custom attributes.Reviewed by Cursor Bugbot for commit c38ecb6. Bugbot is set up for automated code reviews on this repo. Configure here.