Skip to content

Commit

Permalink
Sync main to feature/dmlib (#3663)
Browse files Browse the repository at this point in the history
* Reword the curl proxy fix changelog entry. (#3606)

* Add Emma Zhu as code owner (#3605)

* Short circuit out of msdocs publish if no package locations are specified (#3607)

Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>

* sdk/core: Reimplement Md5OpenSSL using EVP API (#3609)

The MD5_Init/Update/Final functions are deprecated in OpenSSL 3.0 and result in
a compile-time warning. Due to the default usage of -Werror during compilation,
these warnings are treated as errors and prevent the SDK from being built on
Ubuntu 22.04, which ships with OpenSSL by default. The deprecated APIs should
be replaced by the EVP APIs, which are already in use for the SHA family of
functions, and supported on all versions of OpenSSL.

* API Review Feedback for Attestation SDK (#3543)

* API Review Feedback for Attestation SDK

* Updated changelog to reflect API Review updates

* Remove version pin for OpenSSL (#3610)

* Remove version pin for OpenSSL

* Gratuitous change to trigger CI pipelines

* Update the version tool to the latest (#3616)

Co-authored-by: sima-zhu <sizhu@microsoft.com>

* Get rid of warnings in nullable.hpp (#3617)

* cl (#3613)

* Update pipeline-generator version (#3623)

Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>

* Prepare Attestation SDK for May Release. (#3625)

* Prepare attestation for May release

* Removed some noise from changelog

* Increment package version after release of azure-core (#3624)

* Update CODEOWNERS (#3628)

* Fix identity samples running in CI (#3632)

* azure identity may 2022 release (#3615)

* Increment package version after release of azure-identity (#3637)

* Removed uwp-x86 from platform matrix. (#3629)

* Increment package version after release of azure-security-attestation (#3636)

* Update readme for -pre and -post TestResource scripts (#3645)

Co-authored-by: Christopher Scott <chriss@microsoft.com>

* Fixed a bug where text of XML element cannot be empty. (#3643)

* String parsing improvements to service directory resource names (#3644)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Adding Acknowledgments (#3611)

* cl

* Update sdk/core/azure-core/CHANGELOG.md

Co-authored-by: Ahson Khan <ahkha@microsoft.com>

* cspell

Co-authored-by: Ahson Khan <ahkha@microsoft.com>

* Add skip variable for remove test resources to support debugging (#3648)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>

* Storage Blob Stg78 Features (#3650)

* Clean up target_include_directories() (#3641)

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

* Update all-inclusive headers, and CMakeFiles for including all headers (#3640)

* Remove (#3657)

oexcept specifier from Context::IsCancelled()

Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>

Co-authored-by: Ahson Khan <ahson_ahmedk@yahoo.com>
Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com>
Co-authored-by: Patrick Hallisey <pahallis@microsoft.com>
Co-authored-by: Jeremi Piotrowski <jeremi.piotrowski@gmail.com>
Co-authored-by: Larry Osterman <LarryOsterman@users.noreply.github.com>
Co-authored-by: sima-zhu <sizhu@microsoft.com>
Co-authored-by: Victor Vazquez <victor.vazquez@microsoft.com>
Co-authored-by: Rick Winter <rick.winter@microsoft.com>
Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com>
Co-authored-by: Christopher Scott <chriss@microsoft.com>
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
Co-authored-by: Ahson Khan <ahkha@microsoft.com>
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
  • Loading branch information
14 people committed May 24, 2022
1 parent 83b027d commit 12d03f0
Show file tree
Hide file tree
Showing 113 changed files with 3,584 additions and 302 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
################

# Git Hub integration and bot rules
/.github/ @AlexGhiondea @jsquire @rickwinter
/.github/ @jsquire @rickwinter

###########
# SDK
Expand Down
3 changes: 3 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
"Intel",
"itfactor",
"iusg",
"jepio",
"Jeremi",
"Kirilov",
"lcov",
"LIBCMTD",
Expand All @@ -89,6 +91,7 @@
"okhttp",
"PBYTE",
"pdbs",
"Piotrowski",
"PUCHAR",
"pwsh",
"Ragrs",
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ include(AzureVersion)

if(BUILD_SAMPLES)
add_subdirectory(samples/helpers/get-env)
add_subdirectory(samples/helpers/service)
endif()

# sub-projects
Expand Down
4 changes: 2 additions & 2 deletions eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ try {
$BaseName = 't' + (New-Guid).ToString('n').Substring(0, 16)
Log "Generated base name '$BaseName' for CI build"
} else {
$BaseName = GetBaseName $UserName $ServiceDirectory
$BaseName = GetBaseName $UserName (GetServiceLeafDirectoryName $ServiceDirectory)
Log "BaseName was not set. Using default base name '$BaseName'"
}
}
Expand Down Expand Up @@ -520,7 +520,7 @@ try {
$ResourceGroupName
} elseif ($CI) {
# Format the resource group name based on resource group naming recommendations and limitations.
"rg-{0}-$BaseName" -f ($serviceName -replace '[\\\/:]', '-').Substring(0, [Math]::Min($serviceName.Length, 90 - $BaseName.Length - 4)).Trim('-')
"rg-{0}-$BaseName" -f ($serviceName -replace '[\.\\\/:]', '-').ToLowerInvariant().Substring(0, [Math]::Min($serviceName.Length, 90 - $BaseName.Length - 4)).Trim('-')
} else {
"rg-$BaseName"
}
Expand Down
43 changes: 43 additions & 0 deletions eng/common/TestResources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,49 @@ setx KEYVAULT_SKU ${env:KEYVAULT_SKU}
setx AZURE_KEYVAULT_URL ${env:AZURE_KEYVAULT_URL}
```

### Pre- and Post- Scripts

Sometimes creating test resources requires either some work to be done prior to or after the main test-resources.json script is executed.
For these scenarios a `test-resources-pre.ps1` or `test-resources-post.ps1`, respectively, can be created in the same folder as the `test-resources.json` file.

For example, it may be necessary to create artifacts prior to provisioning the actual resource, such as a certificate.
Typically the created artifact will need to be passed to `test-resources.json` to be used in the ARM template or as output (or both).

Below is an example of how `$templateFileParameters` can be used to pass data from the `pre-` script to `test-resources.json`.

**Snippet from `test-resources-pre.ps1`**
```powershell
$cert = New-X509Certificate2 -SubjectName 'E=opensource@microsoft.com, CN=Azure SDK, OU=Azure SDK, O=Microsoft, L=Frisco, S=TX, C=US' -ValidDays 3652
# Create new entries in $templateFileParameters
$templateFileParameters['ConfidentialLedgerPrincipalPEM'] = Format-X509Certificate2 -Certificate $cert
$templateFileParameters['ConfidentialLedgerPrincipalPEMPK'] = Format-X509Certificate2 -Type Pkcs8 -Certificate $cert
```

**Snippet from the corresponding `test-resources.json`.**

Note that the values present in `$templateFileParameters` will map to parameters of the same name.
```json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"_comment": "Other required parameters would go here... (this is not part of the actual test-resources.json)",
"ConfidentialLedgerPrincipalPEM": {
"type": "string",
"metadata": {
"description": "The certificate to configure as a certBasedSecurityPrincipal."
}
},
"ConfidentialLedgerPrincipalPEMPK": {
"type": "string",
"metadata": {
"description": "The certificate to configure as a certBasedSecurityPrincipal."
}
}
},
}
```

### Cleaning up Resources

By default, resource groups are tagged with a `DeleteAfter` value and date according to the default or specified
Expand Down
5 changes: 3 additions & 2 deletions eng/common/TestResources/SubConfig-Helpers.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function BuildServiceDirectoryPrefix([string]$serviceName) {
$serviceName = $serviceName -replace '[\./\\]', '_'
return $serviceName.ToUpperInvariant() + "_"
}

Expand All @@ -17,8 +18,8 @@ function GetUserName() {

function GetBaseName([string]$user, [string]$serviceDirectoryName) {
# Handle service directories in nested directories, e.g. `data/aztables`
$serviceDirectorySafeName = $serviceDirectoryName -replace '[/\\]', ''
return "$user$serviceDirectorySafeName"
$serviceDirectorySafeName = $serviceDirectoryName -replace '[\./\\]', ''
return "$user$serviceDirectorySafeName".ToLowerInvariant()
}

function ShouldMarkValueAsSecret([string]$serviceName, [string]$key, [string]$value, [array]$allowedValues = @())
Expand Down
2 changes: 1 addition & 1 deletion eng/common/TestResources/remove-test-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ steps:
-Force `
-Verbose
displayName: Remove test resources
condition: eq(variables['CI_HAS_DEPLOYED_RESOURCES'], 'true')
condition: and(eq(variables['CI_HAS_DEPLOYED_RESOURCES'], 'true'), ne(variables['Skip.RemoveTestResources'], 'true'))
continueOnError: true
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ steps:
- script: >
dotnet tool install
Azure.Sdk.Tools.PipelineGenerator
--version 1.0.2-dev.20220321.1
--version 1.0.2-dev.20220504.1
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json
--tool-path ${{parameters.ToolPath}}
workingDirectory: $(Pipeline.Workspace)/pipeline-generator
Expand Down
3 changes: 0 additions & 3 deletions eng/pipelines/templates/stages/platform-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@
}
},
"TargetArchitecture": {
"x86": {
"CMAKE_GENERATOR_PLATFORM": "Win32"
},
"x64": {
"CMAKE_GENERATOR_PLATFORM": "x64",
"VCPKG_DEFAULT_TRIPLET": "x64-uwp"
Expand Down
17 changes: 17 additions & 0 deletions samples/helpers/service/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: MIT

cmake_minimum_required (VERSION 3.12)
project(service LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

add_library(
service
INTERFACE
inc/azure/service/client.hpp
)

target_include_directories(service INTERFACE inc)
21 changes: 21 additions & 0 deletions samples/helpers/service/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Microsoft Corporation. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions samples/helpers/service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generic Service for Samples

This is a helper library for samples that provides a generic service client library.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ namespace Azure { namespace Service {

public:
explicit Client(
const std::string& someParameter,
const std::string& serviceUrl,
std::shared_ptr<Core::Credentials::TokenCredential> credential)
: m_credential(std::move(credential))
{
static_cast<void>(someParameter); // to suppress the "unused variable" warning.
static_cast<void>(serviceUrl); // to suppress the "unused variable" warning.
}

void DoSomething(const Core::Context& context) const
Expand Down
11 changes: 6 additions & 5 deletions samples/integration/vcpkg-all-smoke/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include <azure/attestation.hpp>
#include <azure/core.hpp>
#include <azure/identity.hpp>
#include <azure/keyvault/keyvault_certificates.hpp>
#include <azure/keyvault/keyvault_keys.hpp>
#include <azure/keyvault/keyvault_secrets.hpp>
#include <azure/keyvault/certificates.hpp>
#include <azure/keyvault/keys.hpp>
#include <azure/keyvault/secrets.hpp>
#include <azure/storage/blobs.hpp>
#include <azure/storage/files/datalake.hpp>
#include <azure/storage/files/shares.hpp>
Expand Down Expand Up @@ -67,10 +67,11 @@ int main()
ShareLeaseClient shareLeaseClient(shareFileClient, leaseID);
ShareServiceClient shareServiceClient(smokeUrl);

//Attestation
// Attestation
std::cout << "Creating Attestation Clients" << std::endl;
AttestationClient attestationClient(AttestationClient::Create(smokeUrl));
AttestationAdministrationClient attestationAdminClient(AttestationAdministrationClient::Create(smokeUrl, credential));
AttestationAdministrationClient attestationAdminClient(
AttestationAdministrationClient::Create(smokeUrl, credential));

std::cout << "Successfully Created the Clients" << std::endl;
}
Expand Down
2 changes: 1 addition & 1 deletion samples/integration/vcpkg-keyvault/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <azure/core.hpp>
#include <azure/identity.hpp>
#include <azure/keyvault/keyvault_keys.hpp>
#include <azure/keyvault/keys.hpp>

#include <chrono>
#include <iostream>
Expand Down
14 changes: 8 additions & 6 deletions sdk/attestation/azure-security-attestation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0-beta.3 (Unreleased)

### Features Added

No new features, addressed API Review Feedback.

### Breaking Changes

Breaking Changes from API Review
### Bugs Fixed

### Other Changes

## 1.0.0-beta.2 (2022-05-10)

### Breaking Changes

- Renamed `AttestationOpenIdMetadata` type to `OpenIdMetadata`.
- Renamed `AttestationSigningCertificateResult` type to `TokenValidationCertificateResult` to more accurately reflect the
Expand Down Expand Up @@ -36,8 +40,6 @@ Breaking Changes from API Review
- `AttestationAdministrationClient::RemovePolicyManagementCertificate` becomes `AttestationAdministrationClient::RemoveIsolatedModeCertificate`.
- Removed `ClientVersion` API from `AttestationClient` and `AttestationAdministrationClient`

### Bugs Fixed

### Other Changes

- Added `Endpoint` property to `AttestationClient` and `AttestationAdministrationClient`
Expand Down
46 changes: 23 additions & 23 deletions sdk/attestation/azure-security-attestation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,38 @@ find_package(OpenSSL REQUIRED)

set(
AZURE_ATTESTATION_HEADER
inc/azure/attestation/dll_import_export.hpp
inc/azure/attestation/attestation_client.hpp
inc/azure/attestation/attestation_administration_client.hpp
inc/azure/attestation.hpp
inc/azure/attestation/attestation_client.hpp
inc/azure/attestation/attestation_client_models.hpp
inc/azure/attestation/attestation_client_options.hpp

src/private/package_version.hpp
src/private/attestation_common_request.hpp
src/private/attestation_deserializers_private.hpp

src/private/attestation_client_models_private.hpp
src/private/crypto/inc/crypto.hpp

src/private/attestation_client_private.hpp)
inc/azure/attestation/dll_import_export.hpp
inc/azure/attestation/rtti.hpp
inc/azure/attestation.hpp
)

set(
AZURE_ATTESTATION_SOURCE
src/attestation_client.cpp
src/attestation_administration_client.cpp
src/attestation_client_options.cpp
src/private/crypto/inc/crypto.hpp
src/private/crypto/openssl/openssl_helpers.hpp
src/private/crypto/openssl/opensslcert.cpp
src/private/crypto/openssl/opensslcert.hpp
src/private/crypto/openssl/opensslcrypto.cpp
src/private/crypto/openssl/opensslkeys.cpp
src/private/crypto/openssl/opensslkeys.hpp
src/private/attestation_client_models_private.hpp
src/private/attestation_client_private.cpp
src/private/attestation_client_private.hpp
src/private/attestation_common_request.cpp
src/private/attestation_common_request.hpp
src/private/attestation_deserializers_private.cpp
src/private/attestation_deserializers_private.hpp
src/private/jsonhelpers.cpp
src/private/attestation_client_private.cpp)

set(
AZURE_ATTESTATION_SOURCE
${AZURE_ATTESTATION_SOURCE}
src/private/crypto/openssl/opensslcrypto.cpp
src/private/crypto/openssl/opensslkeys.cpp
src/private/crypto/openssl/opensslcert.cpp)
src/private/jsonhelpers_private.hpp
src/private/package_version.hpp
src/attestation_administration_client.cpp
src/attestation_client.cpp
src/attestation_client_options.cpp
)

add_library(azure-security-attestation ${AZURE_ATTESTATION_HEADER} ${AZURE_ATTESTATION_SOURCE})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@

#include "attestation/attestation_administration_client.hpp"
#include "attestation/attestation_client.hpp"
#include "attestation/attestation_client_models.hpp"
#include "attestation/attestation_client_options.hpp"
#include "attestation/dll_import_export.hpp"
#include "attestation/rtti.hpp"
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define AZURE_ATTESTATION_VERSION_MAJOR 1
#define AZURE_ATTESTATION_VERSION_MINOR 0
#define AZURE_ATTESTATION_VERSION_PATCH 0
#define AZURE_ATTESTATION_VERSION_PRERELEASE "beta.2"
#define AZURE_ATTESTATION_VERSION_PRERELEASE "beta.3"

#define AZURE_ATTESTATION_VERSION_ITOA_HELPER(i) #i
#define AZURE_ATTESTATION_VERSION_ITOA(i) AZURE_ATTESTATION_VERSION_ITOA_HELPER(i)
Expand Down
23 changes: 20 additions & 3 deletions sdk/core/azure-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# Release History

## 1.6.0-beta.1 (Unreleased)
## 1.7.0-beta.1 (Unreleased)

### Features Added

- Add `Azure::Core::Http::Request` constructor overload to support payload and non-buffered response.

### Breaking Changes

- Removed `noexcept` specification from `Azure::Core::Context::IsCancelled()`.

### Bugs Fixed

### Other Changes

## 1.6.0 (2022-05-05)

### Features Added

- Add `Azure::Core::Http::Request` constructor overload to support payload and non-buffered response.

### Bugs Fixed

- [[#3537]](https://github.com/Azure/azure-sdk-for-cpp/issues/3537) Updated field type `CurlTransportOptions.Proxy` from `std::string` to `Azure::Nullable<std::string>`. This allows libcurl to ignore the proxy settings from the environment when the string is empty.
Expand All @@ -16,6 +26,13 @@
### Other Changes

- [[#3581]](https://github.com/Azure/azure-sdk-for-cpp/issues/3581) Update log level in retry policy from warning to informational.
- Updated the MD5 Hash implementation to work on top of OpenSSL 3.0. (A community contribution, courtesy of _[jepio](https://github.com/jepio)_)

### Acknowledgments

Thank you to our developer community members who helped to make Azure Core better with their contributions to this release:

- Jeremi Piotrowski _([GitHub](https://github.com/jepio))_

## 1.5.0 (2022-03-31)

Expand Down

0 comments on commit 12d03f0

Please sign in to comment.