Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
25181bd
generated code for azcerts
seankane-msft Jan 3, 2022
1e1241f
add readme and doc.go files
seankane-msft Jan 3, 2022
ff536ce
formatting, added BeginCreateCertificate, although not a poller yet
seankane-msft Jan 6, 2022
94449f0
starting GetCertificate
seankane-msft Jan 7, 2022
215d552
adding GetCertificate endpoint
seankane-msft Jan 7, 2022
6897a98
changed to a poller using GetCertificate, should be with GetCertifica…
seankane-msft Jan 7, 2022
7d81713
adding GetCertificateOperation
seankane-msft Jan 7, 2022
d989a97
added several more methods
seankane-msft Jan 7, 2022
c41f511
adding list certs method
seankane-msft Jan 7, 2022
cc005b3
ListCertificates implementation, but test is not working yet
seankane-msft Jan 7, 2022
0632bf1
adding CreateIssuer method
seankane-msft Jan 10, 2022
3610390
adding GetIssuer
seankane-msft Jan 10, 2022
ac30209
adding issuer pager
seankane-msft Jan 10, 2022
41d88ca
adding delete issuer method
seankane-msft Jan 10, 2022
1c1a8da
doc updates and UpdateIssuer method
seankane-msft Jan 10, 2022
f365334
Adding contacts crud operations
seankane-msft Jan 10, 2022
06ad7c4
adding Get and Update CertificatePolicy
seankane-msft Jan 13, 2022
d6b6c94
adding UpdateCertificateProperties
seankane-msft Jan 13, 2022
9a53087
Added BeginRecoverDeletedCert method
seankane-msft Jan 14, 2022
2f0eb85
restore certificate backup
seankane-msft Jan 18, 2022
51595f4
removing the poller.go file
seankane-msft Jan 18, 2022
dc8d458
adding list deleted certs func
seankane-msft Jan 18, 2022
834e470
last test
seankane-msft Jan 18, 2022
451b5ae
adding certificates to eng/config.json
seankane-msft Jan 18, 2022
7476121
merge conflict
seankane-msft Jan 18, 2022
90ef078
removing generated from two public models
seankane-msft Jan 18, 2022
789405f
adding ci.yml file
seankane-msft Jan 18, 2022
d14d3db
trigger ci run
seankane-msft Jan 18, 2022
83d2541
adding license file, format header, and running go fmt
seankane-msft Jan 18, 2022
90d4581
adding examples and readme
seankane-msft Jan 18, 2022
7b7fd58
adding delete and cancel operation funcs
seankane-msft Jan 18, 2022
4a4c6e3
error handling on examples
seankane-msft Jan 18, 2022
61aaf20
updating broken link
seankane-msft Jan 18, 2022
4dfff42
adding a changelog
seankane-msft Jan 18, 2022
5865e79
changing Tags to map[string]string
seankane-msft Jan 20, 2022
be90a9e
updating comments, pagers
seankane-msft Jan 20, 2022
33f4783
formatting
seankane-msft Jan 21, 2022
d1dabb1
Only fetch provision application oid via API if not supplied (#16878)
azure-sdk Jan 21, 2022
8b56a70
More resilient updating of ExpiringResource (#16789)
chlowell Jan 21, 2022
2483b3b
Sync eng/common directory with azure-sdk-tools for PR 2585 (#16876)
azure-sdk Jan 21, 2022
342febc
Sync eng/common directory with azure-sdk-tools for PR 2596 (#16894)
azure-sdk Jan 21, 2022
fa22cec
Sync eng/common directory with azure-sdk-tools for PR 2578 (#16895)
azure-sdk Jan 22, 2022
620b1cf
renaming
seankane-msft Jan 24, 2022
583ac9d
Changes for AZURE_CLIENT_SEND_CERTIFICATE_CHAIN (#16851)
christothes Jan 24, 2022
2914878
Update CHANGELOG.md (#16903)
seankane-msft Jan 24, 2022
279f88c
Increment version for internal releases (#16905)
azure-sdk Jan 24, 2022
0a7ba04
Sync eng/common directory with azure-sdk-tools for PR 2581 (#16910)
azure-sdk Jan 24, 2022
7327e7c
Syncing eng/common (#16904)
azure-sdk Jan 25, 2022
8c965f7
[Release] sdk/resourcemanager/storage/armstorage/0.4.0 generation fro…
Alancere Jan 25, 2022
7c52b0d
[Tables] updating recordings for latest breaking change (#16906)
seankane-msft Jan 25, 2022
1f46830
Update azidentity recordings (#16912)
chlowell Jan 25, 2022
4710447
[KeyVault] Update recordings (#16917)
seankane-msft Jan 25, 2022
b3f0e10
[azservicebus] Fixing several reliability/recovery bugs (#16831)
richardpark-msft Jan 25, 2022
4b8c2a1
fix incidentally added path addition (#16918)
azure-sdk Jan 26, 2022
916bcb2
sdk generation pipeline script (#16782)
chunyu3 Jan 26, 2022
3fbaf8b
remove greedy suffix on link check (#16922)
azure-sdk Jan 26, 2022
d653770
remove (#16919)
Alancere Jan 27, 2022
e6b2988
Use Payload() for reading response bodies (#16911)
jhendrixMSFT Jan 27, 2022
7834ab5
[azservicebus] Explicitly reference gin-gonic until nhooyr.io/websock…
richardpark-msft Jan 27, 2022
0c3eb35
return *Client
seankane-msft Jan 27, 2022
aabe95e
removing LRO and pager interfaces
seankane-msft Jan 27, 2022
f23acc0
all tests passing again
seankane-msft Jan 27, 2022
3f27572
updating and fixing a couple bugs, newest autorest version
seankane-msft Jan 27, 2022
5f1d609
updating embedded models
seankane-msft Jan 27, 2022
609b2dd
formatting
seankane-msft Jan 28, 2022
d1ff9d7
updating to latest internal
seankane-msft Jan 28, 2022
f4ce9ec
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-go into…
seankane-msft Jan 28, 2022
a95fa42
adding to doc.go
seankane-msft Jan 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 30 additions & 0 deletions codegen_to_sdk_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"init": {
"initScript": {
"path": "./eng/scripts/automation_init.sh",
"logPrefix": "[GO]",
"stderr":{
"storeAllLog": true
}
}
},
"generateAndBuild": {
"generateAndBuildScript": {
"path": "generator automation-v2",
"logPrefix": "[GO-Generate]",
"stderr":{
"storeLogByFilter": "[error|Error|Exception]"
}
}
},
"mockTest": {
"mockTestScript": {
"path": "./eng/scripts/automation/Invoke-MockTest.ps1",
"script": "pwsh",
"logPrefix": "[GO-MockTest]",
"stderr":{
"storeLogByFilter": "[error|Error|Exception]"
}
}
}
}
20 changes: 13 additions & 7 deletions eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ param (
[ValidatePattern('^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$')]
[string] $ProvisionerApplicationId,

[Parameter(ParameterSetName = 'Provisioner', Mandatory = $false)]
[ValidatePattern('^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$')]
[string] $ProvisionerApplicationOid,

[Parameter(ParameterSetName = 'Provisioner', Mandatory = $true)]
[string] $ProvisionerApplicationSecret,

Expand Down Expand Up @@ -155,7 +159,7 @@ function NewServicePrincipalWrapper([string]$subscription, [string]$resourceGrou
$appId = $servicePrincipal.AppId
} else {
Write-Verbose "Creating service principal credential via MS Graph API"
# In 7.1.0 the password credential issue was fixed (see https://github.com/Azure/azure-powershell/pull/16690) but the
# In 5.2.0 the password credential issue was fixed (see https://github.com/Azure/azure-powershell/pull/16690) but the
# parameter set was changed making the above call fail due to a missing ServicePrincipalId parameter.
$credential = Retry { $servicePrincipal | New-AzADSpCredential }
$spPassword = ConvertTo-SecureString $credential.SecretText -AsPlainText -Force
Expand Down Expand Up @@ -481,19 +485,19 @@ try {
$context = Get-AzContext;

# Make sure the provisioner OID is set so we can pass it through to the deployment.
$provisionerApplicationOid = if (!$ProvisionerApplicationId) {
if (!$ProvisionerApplicationId -and !$ProvisionerApplicationOid) {
if ($context.Account.Type -eq 'User') {
$user = Get-AzADUser -UserPrincipalName $context.Account.Id
$user.Id
$ProvisionerApplicationOid = $user.Id
} elseif ($context.Account.Type -eq 'ServicePrincipal') {
$sp = Get-AzADServicePrincipal -ApplicationId $context.Account.Id
$sp.Id
$ProvisionerApplicationOid = $sp.Id
} else {
Write-Warning "Getting the OID for provisioner type '$($context.Account.Type)' is not supported and will not be passed to deployments (seldom required)."
}
} else {
} elseif (!$ProvisionerApplicationOid) {
$sp = Get-AzADServicePrincipal -ApplicationId $ProvisionerApplicationId
$sp.Id
$ProvisionerApplicationOid = $sp.Id
}

# If the ServiceDirectory has multiple segments use the last directory name
Expand Down Expand Up @@ -651,7 +655,9 @@ try {
baseName = $BaseName
testApplicationId = $TestApplicationId
testApplicationOid = "$TestApplicationOid"
provisionerApplicationOid = "$provisionerApplicationOid"
}
if ($ProvisionerApplicationOid) {
$templateParameters["provisionerApplicationOid"] = "$ProvisionerApplicationOid"
}

if ($TenantId) {
Expand Down
4 changes: 3 additions & 1 deletion eng/common/docgeneration/Generate-DocIndex.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ function GenerateDocfxTocContent([Hashtable]$tocContent, [String]$lang, [String]
$serviceName = $serviceMapping.Value[0]
$displayName = $serviceMapping.Value[1]

$fileName = ($serviceName -replace '\s', '').ToLower().Trim()
# handle spaces in service name, EG "Confidential Ledger"
# handle / in service name, EG "Database for MySQL/PostgreSQL". Leaving a "/" present will generate a bad link location.
$fileName = ($serviceName -replace '\s', '').Replace("/","").ToLower().Trim()
if ($visitedService.ContainsKey($serviceName)) {
if ($displayName) {
Add-Content -Path "$($YmlPath)/${fileName}.md" -Value "#### $artifact`n##### ($displayName)"
Expand Down
5 changes: 2 additions & 3 deletions eng/common/pipelines/templates/steps/retain-run.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
- name: DaysValid
default: 365
default: 731
type: number

steps:
Expand All @@ -16,7 +16,6 @@ steps:
-Project $(System.TeamProject)
-DefinitionId $(System.DefinitionId)
-RunId $(Build.BuildId)
-OwnerId Pipeline
-DaysValid ${{parameters.DaysValid}}
-DaysValid ${{ parameters.DaysValid }}
-AccessToken $env:SYSTEM_ACCESSTOKEN
-Debug
2 changes: 1 addition & 1 deletion eng/common/pipelines/templates/steps/verify-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parameters:
Recursive: $false
CheckLinkGuidance: $true
Urls: '(Get-ChildItem -Path ./ -Recurse -Include *.md)'
BranchReplaceRegex: "^(${env:SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI}.*/(?:blob|tree)/)$(DefaultBranch)(/.*)$"
BranchReplaceRegex: "^(${env:SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI}/(?:blob|tree)/)$(DefaultBranch)(/.*)$"
BranchReplacementName: "${env:SYSTEM_PULLREQUEST_SOURCECOMMITID}"
Condition: succeeded() # If you want to run on failure for the link checker, set it to `Condition: succeededOrFailed()`.

Expand Down
29 changes: 17 additions & 12 deletions eng/common/scripts/Add-RetentionLease.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,33 @@ param(
[Parameter(Mandatory = $true)]
[int]$RunId,

[Parameter(Mandatory = $true)]
[string]$OwnerId,

[Parameter(Mandatory = $true)]
[int]$DaysValid,

[Parameter(Mandatory = $true)]
[string]$AccessToken
[Parameter(Mandatory = $false)]
[string]$OwnerId = "azure-sdk-pipeline-automation",

[Parameter(Mandatory = $false)]
[string]$AccessToken = $env:DEVOPS_PAT
)

Set-StrictMode -Version 3

. (Join-Path $PSScriptRoot common.ps1)

$unencodedAuthToken = "nobody:$AccessToken"
$unencodedAuthTokenBytes = [System.Text.Encoding]::UTF8.GetBytes($unencodedAuthToken)
$encodedAuthToken = [System.Convert]::ToBase64String($unencodedAuthTokenBytes)

# We are doing this here so that there is zero chance that this token is emitted in Azure Pipelines
# build logs. Azure Pipelines will see this text and register the secret as a value it should *** out
# before being transmitted to the server (and shown in logs). It means if the value is accidentally
# leaked anywhere else that it won't be visible. The downside is that when the script is executed
# on a local development box, it will be visible.
Write-Host "##vso[task.setvariable variable=_throwawayencodedaccesstoken;issecret=true;]$($encodedAuthToken)"
if ($isDevOpsRun) {
# We are doing this here so that there is zero chance that this token is emitted in Azure Pipelines
# build logs. Azure Pipelines will see this text and register the secret as a value it should *** out
# before being transmitted to the server (and shown in logs). It means if the value is accidentally
# leaked anywhere else that it won't be visible. The downside is that when the script is executed
# on a local development box, it will be visible.
Write-Host "##vso[task.setvariable variable=_throwawayencodedaccesstoken;issecret=true;]$($encodedAuthToken)"
}

. (Join-Path $PSScriptRoot common.ps1)

LogDebug "Checking for existing leases on run: $RunId"
$existingLeases = Get-RetentionLeases -Organization $Organization -Project $Project -DefinitionId $DefinitionId -RunId $RunId -OwnerId $OwnerId -Base64EncodedAuthToken $encodedAuthToken
Expand Down
81 changes: 81 additions & 0 deletions eng/common/scripts/Get-AADIdentityFromGithubUser.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<#
.DESCRIPTION
Get the corresponding ms alias from github identity
.PARAMETER AadToken
The aad access token.
.PARAMETER GithubName
Github identity. E.g sima-zhu
.PARAMETER ContentType
Content type of http requests.
.PARAMETER AdditionalHeaders
Additional parameters for http request headers in key-value pair format, e.g. @{ key1 = val1; key2 = val2; key3 = val3}
#>
[CmdletBinding(SupportsShouldProcess = $true)]
param(
[Parameter(Mandatory = $true)]
[string]$TenantId,

[Parameter(Mandatory = $true)]
[string]$ClientId,

[Parameter(Mandatory = $true)]
[string]$ClientSecret,

[Parameter(Mandatory = $true)]
[string]$GithubUser
)
Set-StrictMode -Version 3

. "${PSScriptRoot}\common.ps1"

$OpensourceAPIBaseURI = "https://repos.opensource.microsoft.com/api/people/links/github/$GithubUser"

function Generate-AadToken ($TenantId, $ClientId, $ClientSecret) {
$LoginAPIBaseURI = "https://login.microsoftonline.com/$TenantId/oauth2/token"
try {
$headers = @{
"content-type" = "application/x-www-form-urlencoded"
}

$body = @{
"grant_type" = "client_credentials"
"client_id" = $ClientId
"client_secret" = $ClientSecret
"resource" = "api://repos.opensource.microsoft.com/audience/7e04aa67"
}
Write-Host "Generating aad token..."
$resp = Invoke-RestMethod $LoginAPIBaseURI -Method 'POST' -Headers $headers -Body $body
}
catch {
LogError $_
exit 1
}

return $resp.access_token
}

$Headers = @{
"Content-Type" = "application/json"
"api-version" = "2019-10-01"
}

try {
$opsAuthToken = Generate-AadToken -TenantId $TenantId -ClientId $ClientId -ClientSecret $ClientSecret
$Headers["Authorization"] = "Bearer $opsAuthToken"
Write-Host "Fetching aad identity for github user: $GithubName"
$resp = Invoke-RestMethod $OpensourceAPIBaseURI -Method 'GET' -Headers $Headers
}
catch {
LogError $_
exit 1
}

$resp | Write-Verbose

if ($resp.aad) {
Write-Host "Fetched aad identity $($resp.aad.alias) for github user $GithubName."
return $resp.aad.alias
}

LogError "Failed to retrieve the aad identity from given github user: $GithubName"
exit 1
2 changes: 1 addition & 1 deletion eng/common/scripts/Invoke-DevOpsAPI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function Add-RetentionLease {
$RunId,
$OwnerId,
$DaysValid,
$Base64AuthToken
$Base64EncodedAuthToken
)

$parameter = @{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class StressTestPackageInfo {
[string]$Namespace
[string]$Directory
[string]$ReleaseName
[string]$Dockerfile
[string]$DockerBuildDir
}

function FindStressPackages([string]$directory, [hashtable]$filters = @{}, [switch]$CI) {
Expand Down Expand Up @@ -52,6 +54,8 @@ function NewStressTestPackageInfo([hashtable]$chart, [System.IO.FileInfo]$chartF
Namespace = $namespace.ToLower()
Directory = $chartFile.DirectoryName
ReleaseName = $chart.name
Dockerfile = $chart.annotations.dockerfile
DockerBuildDir = $chart.annotations.dockerbuilddir
}
}

Expand Down
23 changes: 15 additions & 8 deletions eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ function DeployStressTests(
$subscription = 'Azure SDK Test Resources'
}

if (!$repository) {
$repository = if ($env:USER) { $env:USER } else { "${env:USERNAME}" }
# Remove spaces, etc. that may be in $namespace
$repository -replace '\W'
}

if ($login) {
if (!$clusterGroup -or !$subscription) {
throw "clusterGroup and subscription parameters must be specified when logging into an environment that is not test or prod."
Expand Down Expand Up @@ -156,11 +150,24 @@ function DeployStressPackage(
}
$imageTag += "/$($pkg.Namespace)/$($pkg.ReleaseName):${deployId}"

$dockerFilePath = "$($pkg.Directory)/Dockerfile"
$dockerFilePath = if ($pkg.Dockerfile) {
Join-Path $pkg.Directory $pkg.Dockerfile
} else {
"$($pkg.Directory)/Dockerfile"
}
$dockerFilePath = [System.IO.Path]::GetFullPath($dockerFilePath)

if ($pushImages -and (Test-Path $dockerFilePath)) {
Write-Host "Building and pushing stress test docker image '$imageTag'"
$dockerFile = Get-ChildItem $dockerFilePath
Run docker build -t $imageTag -f $dockerFile.FullName $dockerFile.DirectoryName
$dockerBuildFolder = if ($pkg.DockerBuildDir) {
Join-Path $pkg.Directory $pkg.DockerBuildDir
} else {
$dockerFile.DirectoryName
}
$dockerBuildFolder = [System.IO.Path]::GetFullPath($dockerBuildFolder).Trim()

Run docker build -t $imageTag -f $dockerFile $dockerBuildFolder
if ($LASTEXITCODE) { return }
Run docker push $imageTag
if ($LASTEXITCODE) {
Expand Down
2 changes: 1 addition & 1 deletion eng/common/testproxy/docker-start-proxy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ catch {
Write-Error "Please check your docker invocation and try running the script again."
}

$SELECTED_IMAGE_TAG = "1294199"
$SELECTED_IMAGE_TAG = "1314089"
$CONTAINER_NAME = "ambitious_azsdk_test_proxy"
$LINUX_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-lin:${SELECTED_IMAGE_TAG}"
$WINDOWS_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-win:${SELECTED_IMAGE_TAG}"
Expand Down
2 changes: 1 addition & 1 deletion eng/common/testproxy/test-proxy-tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ steps:
dotnet tool install azure.sdk.tools.testproxy `
--tool-path $(Build.BinariesDirectory)/test-proxy `
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json `
--version 1.0.0-dev.20220113.1
--version 1.0.0-dev.20220119.2
displayName: "Install test-proxy"

- pwsh: |
Expand Down
20 changes: 12 additions & 8 deletions eng/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@
"Name": "azidentity",
"CoverageGoal": 0.68
},
{
"Name": "keyvault/azkeys",
"CoverageGoal": 0.71
},
{
"Name": "azsecrets",
"CoverageGoal": 0.86
},
{
"Name": "data",
"CoverageGoal": 0.62,
Expand All @@ -37,6 +29,18 @@
"Name": "eng/tools",
"CoverageGoal": 0.0
},
{
"Name": "keyvault/azcertificates",
"CoverageGoal": 0.78
},
{
"Name": "keyvault/azkeys",
"CoverageGoal": 0.71
},
{
"Name": "keyvault/azsecrets",
"CoverageGoal": 0.86
},
{
"Name": "keyvault/internal",
"CoverageGoal": 0.40
Expand Down
7 changes: 4 additions & 3 deletions eng/pipelines/templates/steps/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ steps:
displayName: "Install Coverage and Junit Dependencies"

- ${{ if eq(parameters.TestProxy, true) }}:
- template: /eng/common/testproxy/test-proxy-tool.yml
- template: /eng/common/testproxy/test-proxy-docker.yml

- task: PowerShell@2
displayName: 'Run Tests'
Expand All @@ -60,8 +60,9 @@ steps:

- ${{ if eq(parameters.TestProxy, true) }}:
- pwsh: |
# $(Build.SourcesDirectory)/test-proxy.log is the hardcoded output log location for the test-proxy-tool.yml
cat $(Build.SourcesDirectory)/test-proxy.log
# ambitious_azsdk_test_proxy is the hardcoded container name used
# by the test proxy startup script
docker logs ambitious_azsdk_test_proxy
displayName: 'Dump Test Proxy logs'
condition: succeededOrFailed()

Expand Down
Loading