Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## [Unreleased]

### Security

- Resources no longer return the PAT in Get/Test/Set output; `pat` is marked `writeOnly` in the DSC v3 manifests.

### Added


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@
"required": [
"groupOriginId",
"permissionLevel",
"organization",
"pat"
"organization"
],
"properties": {
"groupOriginId": {
Expand Down Expand Up @@ -121,7 +120,8 @@
"pat": {
"title": "Personal Access Token",
"description": "A Personal Access Token with 'Graph > Read & manage' permissions.",
"type": "string"
"type": "string",
"writeOnly": true
},
"apiVersion": {
"title": "API Version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
} | ConvertTo-Json -Compress
Expand Down Expand Up @@ -264,7 +263,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $inDesiredState
} | ConvertTo-Json -Compress
Expand Down Expand Up @@ -320,7 +318,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
} | ConvertTo-Json -Compress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@
"type": "object",
"required": [
"groupOriginId",
"organization",
"pat"
"organization"
],
"properties": {
"groupOriginId": {
Expand Down Expand Up @@ -113,7 +112,8 @@
"pat": {
"title": "Personal Access Token",
"description": "A Personal Access Token with 'Member Entitlement Management > Read & write' permission.",
"type": "string"
"type": "string",
"writeOnly": true
},
"apiVersion": {
"title": "API Version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ switch ($Operation) {
organization = $org
accessLevel = ConvertFrom-LicenseType -LicenseType $group.licenseRule.accountLicenseType
ensure = 'Present'
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
}
Expand All @@ -177,7 +176,6 @@ switch ($Operation) {
organization = $org
accessLevel = $accessLevel
ensure = 'Absent'
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
}
Expand Down Expand Up @@ -212,7 +210,6 @@ switch ($Operation) {
organization = $org
accessLevel = $rAccessLevel
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $inDesiredState
}
Expand Down Expand Up @@ -303,7 +300,6 @@ switch ($Operation) {
organization = $org
accessLevel = $rAccessLevel
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@
"required": [
"userPrincipalName",
"permissionLevel",
"organization",
"pat"
"organization"
],
"properties": {
"userPrincipalName": {
Expand Down Expand Up @@ -112,7 +111,8 @@
"pat": {
"title": "Personal Access Token",
"description": "A Personal Access Token with 'Graph > Read & manage' permissions.",
"type": "string"
"type": "string",
"writeOnly": true
},
"apiVersion": {
"title": "API Version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
} | ConvertTo-Json -Compress
Expand Down Expand Up @@ -250,7 +249,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $inDesiredState
} | ConvertTo-Json -Compress
Expand Down Expand Up @@ -290,7 +288,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
} | ConvertTo-Json -Compress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@
"type": "object",
"required": [
"userPrincipalName",
"organization",
"pat"
"organization"
],
"properties": {
"userPrincipalName": {
Expand Down Expand Up @@ -105,7 +104,8 @@
"pat": {
"title": "Personal Access Token",
"description": "A Personal Access Token with 'Member Entitlement Management > Read & write' permission.",
"type": "string"
"type": "string",
"writeOnly": true
},
"apiVersion": {
"title": "API Version",
Expand Down
4 changes: 0 additions & 4 deletions dsc-resources/organization-user/devops.organization-user.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ switch ($Operation) {
organization = $org
accessLevel = ConvertFrom-LicenseType -LicenseType $user.accessLevel.accountLicenseType
ensure = 'Present'
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
}
Expand All @@ -173,7 +172,6 @@ switch ($Operation) {
organization = $org
accessLevel = $accessLevel
ensure = 'Absent'
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
}
Expand Down Expand Up @@ -206,7 +204,6 @@ switch ($Operation) {
organization = $org
accessLevel = $rAccessLevel
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $inDesiredState
}
Expand Down Expand Up @@ -290,7 +287,6 @@ switch ($Operation) {
organization = $org
accessLevel = $rAccessLevel
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@
"projectName",
"groupOriginId",
"permissionLevel",
"organization",
"pat"
"organization"
],
"properties": {
"projectName": {
Expand Down Expand Up @@ -124,7 +123,8 @@
"pat": {
"title": "Personal Access Token",
"description": "A Personal Access Token with 'Graph > Read & manage' and 'Project and Team > Read' permissions.",
"type": "string"
"type": "string",
"writeOnly": true
},
"apiVersion": {
"title": "API Version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = 'Absent'
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
} | ConvertTo-Json -Compress
Expand All @@ -272,7 +271,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
}
Expand All @@ -295,7 +293,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = 'Absent'
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = ($ensure -eq 'Absent')
} | ConvertTo-Json -Compress
Expand All @@ -320,7 +317,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $inDesiredState
}
Expand Down Expand Up @@ -380,7 +376,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@
"projectName",
"userPrincipalName",
"permissionLevel",
"organization",
"pat"
"organization"
],
"properties": {
"projectName": {
Expand Down Expand Up @@ -115,7 +114,8 @@
"pat": {
"title": "Personal Access Token",
"description": "A Personal Access Token with 'Graph > Read & manage' and 'Project and Team > Read' permissions.",
"type": "string"
"type": "string",
"writeOnly": true
},
"apiVersion": {
"title": "API Version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = 'Absent'
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
} | ConvertTo-Json -Compress
Expand All @@ -244,7 +243,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
}
Expand All @@ -266,7 +264,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = 'Absent'
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = ($ensure -eq 'Absent')
} | ConvertTo-Json -Compress
Expand All @@ -286,7 +283,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $inDesiredState
}
Expand Down Expand Up @@ -330,7 +326,6 @@ switch ($Operation) {
permissionLevel = $permLevel
organization = $org
ensure = $rEnsure
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
}
Expand Down
6 changes: 3 additions & 3 deletions dsc-resources/project/devops.project.dsc.resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@
"type": "object",
"required": [
"projectName",
"organization",
"pat"
"organization"
],
"properties": {
"projectName": {
Expand Down Expand Up @@ -111,7 +110,8 @@
"pat": {
"title": "Personal Access Token",
"description": "A Personal Access Token (PAT) with sufficient permissions to manage projects in the organization.",
"type": "string"
"type": "string",
"writeOnly": true
},
"templateTypeId": {
"title": "Template Type ID",
Expand Down
4 changes: 0 additions & 4 deletions dsc-resources/project/devops.project.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ switch ($Operation) {
sourceControlType = if ($project.capabilities.versioncontrol.sourceControlType) { $project.capabilities.versioncontrol.sourceControlType } else { $scType }
organization = $org
ensure = 'Present'
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
}
Expand All @@ -168,7 +167,6 @@ switch ($Operation) {
sourceControlType = $scType
organization = $org
ensure = 'Absent'
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
}
Expand All @@ -195,7 +193,6 @@ switch ($Operation) {
sourceControlType = if ($exists -and $project.capabilities.versioncontrol.sourceControlType) { $project.capabilities.versioncontrol.sourceControlType } else { $scType }
organization = $org
ensure = if ($exists) { 'Present' } else { 'Absent' }
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $inDesiredState
}
Expand Down Expand Up @@ -258,7 +255,6 @@ switch ($Operation) {
sourceControlType = if ($null -ne $project) { $project.capabilities.versioncontrol.sourceControlType } else { $scType }
organization = $org
ensure = if ($null -ne $project) { 'Present' } else { 'Absent' }
pat = $desired.pat
apiVersion = $apiVersion
_inDesiredState = $null
}
Expand Down
Loading
Loading