Share via


CodeTransparencyClient.GetCodeTransparencyConfig Method

Definition

Overloads

GetCodeTransparencyConfig(RequestContext)

[Protocol Method] Get CodeTransparency configuration information.

GetCodeTransparencyConfig(CancellationToken)

Get CodeTransparency configuration information.

GetCodeTransparencyConfig(RequestContext)

Source:
CodeTransparencyClient.cs

[Protocol Method] Get CodeTransparency configuration information.

public virtual Azure.Response GetCodeTransparencyConfig (Azure.RequestContext context);
abstract member GetCodeTransparencyConfig : Azure.RequestContext -> Azure.Response
override this.GetCodeTransparencyConfig : Azure.RequestContext -> Azure.Response
Public Overridable Function GetCodeTransparencyConfig (context As RequestContext) As Response

Parameters

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

Service returned a non-success status code.

Examples

This sample shows how to call GetCodeTransparencyConfig and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);

Response response = client.GetCodeTransparencyConfig(null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

This sample shows how to call GetCodeTransparencyConfig with all parameters and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);

Response response = client.GetCodeTransparencyConfig(null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("policy").GetProperty("accepted_algorithms")[0].ToString());
Console.WriteLine(result.GetProperty("policy").GetProperty("accepted_did_issuers")[0].ToString());
Console.WriteLine(result.GetProperty("authentication").GetProperty("allow_unauthenticated").ToString());
Console.WriteLine(result.GetProperty("authentication").GetProperty("jwt").GetProperty("required_claims").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("service_identifier").ToString());

Applies to

GetCodeTransparencyConfig(CancellationToken)

Source:
CodeTransparencyClient.cs

Get CodeTransparency configuration information.

public virtual Azure.Response<Azure.Security.CodeTransparency.CodeTransparencyConfiguration> GetCodeTransparencyConfig (System.Threading.CancellationToken cancellationToken = default);
abstract member GetCodeTransparencyConfig : System.Threading.CancellationToken -> Azure.Response<Azure.Security.CodeTransparency.CodeTransparencyConfiguration>
override this.GetCodeTransparencyConfig : System.Threading.CancellationToken -> Azure.Response<Azure.Security.CodeTransparency.CodeTransparencyConfiguration>
Public Overridable Function GetCodeTransparencyConfig (Optional cancellationToken As CancellationToken = Nothing) As Response(Of CodeTransparencyConfiguration)

Parameters

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetCodeTransparencyConfig.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);

Response<CodeTransparencyConfiguration> response = client.GetCodeTransparencyConfig();

This sample shows how to call GetCodeTransparencyConfig with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
CodeTransparencyClient client = new CodeTransparencyClient(endpoint, credential);

Response<CodeTransparencyConfiguration> response = client.GetCodeTransparencyConfig();

Applies to