Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34723.18
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Developer.TrustedSigning", "src\Azure.Developer.TrustedSigning.csproj", "{4EE89576-AB5A-49DA-8A64-CF849414EBC2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Developer.TrustedSigning.Tests", "tests\Azure.Developer.TrustedSigning.Tests.csproj", "{D414EABC-8CED-4465-9413-8DFD0D4BB738}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU
{4EE89576-AB5A-49DA-8A64-CF849414EBC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4EE89576-AB5A-49DA-8A64-CF849414EBC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4EE89576-AB5A-49DA-8A64-CF849414EBC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4EE89576-AB5A-49DA-8A64-CF849414EBC2}.Release|Any CPU.Build.0 = Release|Any CPU
{D414EABC-8CED-4465-9413-8DFD0D4BB738}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D414EABC-8CED-4465-9413-8DFD0D4BB738}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D414EABC-8CED-4465-9413-8DFD0D4BB738}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D414EABC-8CED-4465-9413-8DFD0D4BB738}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
EndGlobalSection
EndGlobal
11 changes: 11 additions & 0 deletions sdk/trustedsigning/Azure.Developer.TrustedSigning/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Release History

## 1.0.0-beta.1 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"output-folder": ".",
"namespace": "Azure.Developer.TrustedSigning",
"library-name": "Azure.Developer.TrustedSigning",
"flavor": "azure",
"use-model-reader-writer": true,
"shared-source-folders": [
"../../TempTypeSpecFiles/node_modules/@autorest/csharp/Generator.Shared",
"../../TempTypeSpecFiles/node_modules/@autorest/csharp/Azure.Core.Shared"
],
"model-namespace": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props
-->
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
</Project>
89 changes: 89 additions & 0 deletions sdk/trustedsigning/Azure.Developer.TrustedSigning/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Azure TrustedSigning client library for .NET

This section should give out brief introduction of the client library.

* First sentence: **Describe the service** briefly. You can usually use the first line of the service's docs landing page for this (Example: [Cosmos DB docs landing page](https://learn.microsoft.com/azure/cosmos-db/)).
* Next, add a **bulleted list** of the **most common tasks** supported by the package or library, prefaced with "Use the client library for [Product Name] to:". Then, provide code snippets for these tasks in the [Examples](#examples) section later in the document. Keep the task list short but include those tasks most developers need to perform with your package.

[Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/trustedsigning/Azure.Developer.TrustedSigning/src) | [Package (NuGet)](https://www.nuget.org/packages/Azure.Developer.TrustedSigning) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://learn.microsoft.com/azure)

## Getting started

This section should include everything a developer needs to do to install and create their first client connection *very quickly*.

### Install the package

First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository.

Install the client library for .NET with [NuGet](https://www.nuget.org/ ):

```dotnetcli
dotnet add package Azure.Developer.TrustedSigning --prerelease
```

### Prerequisites

Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB:

> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://learn.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://learn.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`.

### Authenticate the client

If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating.

For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object.

## Key concepts

The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity.

Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of:

### Thread safety

We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads.

### Additional concepts
<!-- CLIENT COMMON BAR -->
[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) |
[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) |
[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) |
[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) |
[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) |
[Mocking](https://learn.microsoft.com/dotnet/azure/sdk/unit-testing-mocking) |
[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/)
<!-- CLIENT COMMON BAR -->

## Examples

You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/trustedsigning/Azure.Developer.TrustedSigning/samples).

### <scenario>

You can create a client and call the client's `<operation>` method.

```C# Snippet:Azure_Developer_TrustedSigning_Scenario
Console.WriteLine("Hello, world!");
```

## Troubleshooting

Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery.

Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API.

If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code.

## Next steps

* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory.
* If appropriate, point users to other packages that might be useful.
* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for.

## Contributing

This is a template, but your SDK readme should include details on how to contribute code to the repo/package.

<!-- LINKS -->
[style-guide-msft]: https://learn.microsoft.com/style-guide/capitalization
[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace Azure.Developer.TrustedSigning
{
public partial class TrustedSigningClient
{
protected TrustedSigningClient() { }
public TrustedSigningClient(string endpoint, Azure.Core.TokenCredential credential, Azure.Developer.TrustedSigning.TrustedSigningClientOptions options = null) { }
public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } }
}
public partial class TrustedSigningClientOptions : Azure.Core.ClientOptions
{
public TrustedSigningClientOptions(Azure.Developer.TrustedSigning.Generated.TrustedSigningClientOptions.ServiceVersion version = Azure.Developer.TrustedSigning.Generated.TrustedSigningClientOptions.ServiceVersion.V1_0_0) { }
public enum ServiceVersion
{
V1_0_0 = 1,
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
page_type: sample
languages:
- csharp
products:
# Including relevant stubs from https://review.learn.microsoft.com/help/contribute/metadata-taxonomies#product
- azure
name: Azure.Developer.TrustedSigning samples for .NET
description: Samples for the Azure.Developer.TrustedSigning client library.
---

# Azure.Developer.TrustedSigning Samples

<!-- please refer to <https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/samples/README.md> to write sample readme. -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# <scenario_list>

To use these samples, you'll first need to set up resources. See [getting started](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/trustedsigning/Azure.Developer.TrustedSigning/README.md#getting-started) for details.

## <scenario>

You can create a client and call the client's `<operation>` method

<!-- please refer to <https://github.com/Azure/azure-sdk-for-net/main/sdk/template/Azure.Template/samples/Sample1_HelloWorld.md> to write sample readme file. -->
```C# Snippet:Azure_Developer_TrustedSigning_Scenario
Console.WriteLine("Hello, world!");
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# <scenario_list>

To use these samples, you'll first need to set up resources. See [getting started](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/trustedsigning/Azure.Developer.TrustedSigning/README.md#getting-started) for details.

## <scenario> asynchronously

You can create a client and call the client's `<operation>` method

<!-- please refer to <https://github.com/Azure/azure-sdk-for-net/main/sdk/template/Azure.Template/samples/Sample1_HelloWorldAsync.md> to write sample readme file. -->
```C# Snippet:Azure_Developer_TrustedSigning_ScenarioAsync
Console.WriteLine("Hello, world!");
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>This is the TrustedSigning client library for developing .NET applications with rich experience.</Description>
<AssemblyTitle>Azure SDK Code Generation TrustedSigning for Azure Data Plane</AssemblyTitle>
<Version>1.0.0-beta.1</Version>
<PackageTags>Azure TrustedSigning</PackageTags>
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<IncludeOperationsSharedSource>true</IncludeOperationsSharedSource>
</PropertyGroup>

<!-- Shared source from Azure.Core -->
<ItemGroup>
<Compile Include="$(AzureCoreSharedSources)ArrayBufferWriter.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" LinkBase="Shared" />
<Compile Include="$(AzureCoreSharedSources)AzureKeyCredentialPolicy.cs" LinkBase="Shared" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Azure.Core" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<members>
<member name="GetSecretAsync(string,RequestContext)">
<example>
This sample shows how to call GetSecretAsync and parse the result.
<code><![CDATA[
TokenCredential credential = new DefaultAzureCredential();
TrustedSigningClient client = new TrustedSigningClient("<VaultBaseUrl>", credential);

Response response = await client.GetSecretAsync("<secretName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
]]></code>
This sample shows how to call GetSecretAsync with all parameters and parse the result.
<code><![CDATA[
TokenCredential credential = new DefaultAzureCredential();
TrustedSigningClient client = new TrustedSigningClient("<VaultBaseUrl>", credential);

Response response = await client.GetSecretAsync("<secretName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("value").ToString());
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("contentType").ToString());
Console.WriteLine(result.GetProperty("tags").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("kid").ToString());
Console.WriteLine(result.GetProperty("managed").ToString());
]]></code></example>
</member>
<member name="GetSecret(string,RequestContext)">
<example>
This sample shows how to call GetSecret and parse the result.
<code><![CDATA[
TokenCredential credential = new DefaultAzureCredential();
TrustedSigningClient client = new TrustedSigningClient("<VaultBaseUrl>", credential);

Response response = client.GetSecret("<secretName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());
]]></code>
This sample shows how to call GetSecret with all parameters and parse the result.
<code><![CDATA[
TokenCredential credential = new DefaultAzureCredential();
TrustedSigningClient client = new TrustedSigningClient("<VaultBaseUrl>", credential);

Response response = client.GetSecret("<secretName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("value").ToString());
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("contentType").ToString());
Console.WriteLine(result.GetProperty("tags").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("kid").ToString());
Console.WriteLine(result.GetProperty("managed").ToString());
]]></code></example>
</member>
</members>
</doc>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Runtime.CompilerServices;

// Replace with test project/test project public key and uncomment to make internal members visible to
// your test project. If not needed, this can be deleted.
// [assembly: InternalsVisibleTo("Azure.Developer.TrustedSigning.Generated.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")]

// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment.
// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers
// for the list of possible values.
[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Trustedsigning")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>

<!-- We don't care about XML doc comments on test types and members -->
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>

<!-- Reference the Client Library -->
<ItemGroup>
<ProjectReference Include="$(AzureCoreTestFramework)" />
<ProjectReference Include="..\src\Azure.Developer.TrustedSigning.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
</ItemGroup>

<ItemGroup>
<Folder Include="SessionRecords\" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Source files in this directory are written as tests from which samples are extracted.
They are not intended to be viewed directly and help ensure our samples compile and work correctly.
See our [list of samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/trustedsigning/Azure.Developer.TrustedSigning/samples) for more explanation about how to use this client library.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Core.TestFramework;
using NUnit.Framework;

namespace Azure.Developer.TrustedSigning.Tests.Samples
{
public partial class TrustedSigningSamples: SamplesBase<TrustedSigningClientTestEnvironment>
{
/* please refer to https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/tests/Samples/Sample1.HelloWorld.cs to write samples. */
[Test]
[SyncOnly]
public void Scenario()
{
#region Snippet:Azure_Developer_TrustedSigning_Scenario
Console.WriteLine("Hello, world!");
#endregion
}
}
}
Loading