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
@@ -1,5 +1,5 @@
{
"operationId": "CertificateProfileOperations_GetCodeSigningStatus",
"operationId": "CertificateProfileOperations_GetSigningStatus",
"title": "Gets the status of a codesign operation.",
"parameters": {
"codeSigningAccountName": "YourAccountName",
Expand All @@ -11,10 +11,8 @@
"200": {
"body": {
"id": "76f60a30-d088-42e0-b16d-b76b88d3cbe1",
"status": "InProgress",
"signStatus": {
"operationId": "76f60a30-d088-42e0-b16d-b76b88d3cbe1",
"status": "InProgress",
"status": "Succeeded",
"result": {
"signature": "OWY4NmQwODE4ODRjN2Q2NTlhMmZlYWEwYzU1YWQwMTVhM2JmNGYxYjJiMGI4MjJjZDE1ZDZjMTViMGYwMGEwOA==",
"signingCertificate": "N2IzZDk3OWNhODMzMGE5NGZhN2U5ZTFiNDY2ZDhiOTllMGJjZGVhMWVjOTA1OTZjMGRjYzhkN2VmNmI0MzAwYw=="
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"operationId": "CertificateProfileOperations_ListSignEkus",
"operationId": "CertificateProfileOperations_ListExtendedKeyUsages",
"title": "Gets a list of extended key usage object identifiers that are allowed.",
"parameters": {
"codeSigningAccountName": "YourAccountName",
Expand All @@ -9,7 +9,7 @@
"responses": {
"200": {
"body": {
"ekus": [
"eku": [
"1.3.6.1.5.5.7.3.8",
"1.3.6.1.5.5.7.3.10"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,12 @@
"responses": {
"202": {
"headers": {
"azure-async-operation": "http://localhost:8080/operations/76f60a30-d088-42e0-b16d-b76b88d3cbe1"
"operation-location": "https://localhost:5001/codesigningaccount/account/certificateprofile/profile/sign/76f60a30-d088-42e0-b16d-b76b88d3cbe1"
},
"body": {
"id": "76f60a30-d088-42e0-b16d-b76b88d3cbe1",
"status": "InProgress",
"signStatus": {
"operationId": "76f60a30-d088-42e0-b16d-b76b88d3cbe1",
"status": "InProgress",
"signature": "cXVpcyBub3N0cnVkIGV4ZXJjaXRhdGlvbiB1bGxhbWNvIGxhYm9yaXM=",
"signingCertificate": "bmlzaSB1dCBhbGlxdWlwIGV4IGVhIGNvbW1vZG8gY29uc2VxdWF0"
}
"status": "In Progress",
"result": {}
}
}
}
Expand Down
111 changes: 50 additions & 61 deletions specification/codesigning/CodeSigning/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ using Azure.Core;
]>
)
@service({
title: "Azure CodeSigning",
summary: "Azure CodeSigning is a service that provides managed code signing for all.",
title: "Azure Developer Signing",
summary: "Azure Developer Signing is a service that provides managed artifact signing for all.",
})
@versioned(Azure.CodeSigning.Versions)
@versioned(Azure.Developer.Signing.Versions)
@server(
"https://{region}.codesigning.azure.net/",
"CodeSign and retrieve relevant information pertaining signing process.",
"Sign and retrieve relevant information pertaining signing process.",
{
@doc("The Azure region wherein requests for signing will be sent.")
region: string,
}
)
@doc("Azure CodeSigning is a service that provides managed code signing for all.")
namespace Azure.CodeSigning;
@doc("Azure Developer Signing is a service that provides managed artifact signing for all.")
namespace Azure.Developer.Signing;

@doc("Versions info.")
enum Versions {
Expand All @@ -41,35 +41,35 @@ enum Versions {

interface CertificateProfileOperations {
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is a custom operation status endpoint."
@summary("Gets the status of a codesigning operation.")
@summary("Gets the status of a signing operation.")
@doc("This status operation requires that a Sign request has been submitted and the operationId is known.")
@route("/codesigningaccounts/{codeSigningAccountName}/certificateprofiles/{certificateProfileName}/sign/{operationId}")
getCodeSigningStatus is Foundations.GetOperationStatus<
CodeSigningOptions,
CodeSignResult
@route("/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}/sign")
getSigningStatus is Foundations.GetOperationStatus<
SigningOptions,
SignResult
>;

#suppress "@azure-tools/typespec-azure-core/rpc-operation-request-body" "no body included, bytesbody is the response object."
#suppress "@azure-tools/typespec-azure-core/no-rpc-path-params" "Service needs rpc paths to follow pattern of other services."
@summary("Gets the codesigning root certificate on the certificate chain for that account and profile name.")
@summary("Gets the signing root certificate on the certificate chain for that account and profile name.")
@doc("The root certificate is generated as part of the initial account creation and it is used to sign the bits for the profile provided.")
@route("/codesigningaccounts/{codeSigningAccountName}/certificateprofiles/{certificateProfileName}/sign/rootcert")
@route("/codesigningaccounts/{accountName}/certificateprofiles/{certificateProfile}/sign/rootcert")
getSignRootCertificate is RpcOperation<
CodeSigningOptions,
SigningOptions,
BytesBody<"application/x-x509-ca-cert">
>;

@summary("Gets a list of extended key usage object identifiers that are allowed for this account and profile combination.")
@doc("The list of extended key usages are used to determine the purpose of the certificate usage as part of the codesigning operation.")
listSignEkus is StandardResourceOperations.ResourceList<ExtendedKeyUsage>;
@doc("The list of extended key usages are used to determine the purpose of the certificate usage as part of the signing operation.")
listExtendedKeyUsages is StandardResourceOperations.ResourceList<ExtendedKeyUsage>;

@summary("Submit a codesign operation.")
@doc("Submit a codesign operation under the created codesign account and profile name provided.")
@pollingOperation(CertificateProfileOperations.getCodeSigningStatus)
@summary("Submit a sign operation.")
@doc("Submit a sign operation under the created account and profile name provided.")
@pollingOperation(CertificateProfileOperations.getSigningStatus)
sign is StandardResourceOperations.LongRunningResourceAction<
CertificateProfile,
CodeSigningSubmissionOptions,
CodeSignOperationStatus
CertificateProfileName,
SigningPayloadOptions,
SignResult
>;
}

Expand Down Expand Up @@ -106,31 +106,31 @@ enum SignatureAlgorithm {
ES256K,
}

@doc("Azure CodeSigning customer account created upon registration on the service.")
@doc("Azure Developer Signing customer account created upon registration on the service.")
@resource("codesigningaccounts")
model CodeSigningAccount {
@key("codeSigningAccountName")
model SigningAccount {
@key("accountName")
@visibility("read", "update")
@doc("Azure CodeSigning account name.")
codeSigningAccountName: string;
@doc("Azure Developer Signing account name.")
accountName: string;
}

@doc("Azure CodeSigning certificate profile configured on a codesign account.")
@doc("Azure Developer Signing certificate profile configured on an account.")
@resource("certificateprofiles")
@parentResource(CodeSigningAccount)
model CertificateProfile {
@key("certificateProfileName")
@parentResource(SigningAccount)
model CertificateProfileName {
@key("certificateProfile")
@visibility("read", "update")
@doc("Azure Codesigning certificate profile name under a codesign account.")
certificateProfileName: string;
@doc("Azure Developer Signing certificate profile name under an account.")
certificateProfile: string;
}

@doc("The codesign request information to be signed by the service.")
model CodeSigningSubmissionOptions {
@doc("The artifact request information to be signed by the service.")
model SigningPayloadOptions {
@doc("The supported signature algorithm identifiers.")
signatureAlgorithm: SignatureAlgorithm;

@doc("Content digest to codesign.")
@doc("Content digest to sign.")
digest: bytes;

@doc("List of full file digital signatures.")
Expand All @@ -140,49 +140,38 @@ model CodeSigningSubmissionOptions {
authenticodeHashList?: bytes[];
}

@doc("The codesign operation status response.")
model CodeSignOperationStatus {
@doc("Unique Id of the operation.")
id: string;

@doc("The result of the codesign operation including the signature and signing certificate.")
signResult?: CodeSignResult;
}

@doc("The sign status model.")
model CodeSignResult {
@doc("Response Id of the codesign operation.")
operationId: string;
model SignResult {

@doc("Digital signature of the requested content digest.")
signature?: bytes;

@doc("""
Signing certificate corresponding to the private key used to codesign the requested
Signing certificate corresponding to the private key used to sign the requested
digest.
""")
signingCertificate?: bytes;
}

@doc("Codesigning option parameters corresponding to the account and certificate profile name.")
model CodeSigningOptions {
@doc("CodeSigning account name.")
@doc("Signing option parameters corresponding to the account and certificate profile name.")
model SigningOptions {
@doc("Signing account name.")
@path
codeSigningAccountName: string;
accountName: string;

@doc("Certificate profile name.")
@doc("Signing Certificate profile name.")
@path
certificateProfileName: string;
certificateProfile: string;
}

@doc("Extended key usage object identifier that are allowed.")
@doc("Extended key usage object identifier that are allowable.")
@resource("sign/eku")
@parentResource(CertificateProfile)
@parentResource(CertificateProfileName)
model ExtendedKeyUsage {
@key("ekus")
@visibility("read", "update")
@doc("An element of ekus.")
ekus: string[];
@key("eku")
@visibility("read")
@doc("An oid string that represents an eku.")
eku: string;
}

@doc("Public root certificate from the certificate chain.")
Expand Down
16 changes: 8 additions & 8 deletions specification/codesigning/CodeSigning/tspconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ options:
azure-resource-provider-folder: "data-plane"
emitter-output-dir: "{project-root}/.."
examples-directory: "examples"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/azure.codesigning.json"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/azure.developer.signing.json"
"@azure-tools/typespec-python":
package-dir: "azure-codesigning"
package-dir: "azure-developer-signing"
package-name: "{package-dir}"
"@azure-tools/typespec-csharp":
clear-output-folder: true
package-dir: "Azure.CodeSigning"
package-dir: "Azure.Developer.Signing"
model-namespace: false
namespace: "{package-dir}"
"@azure-tools/typespec-ts":
package-dir: "azurecodesigning-rest"
package-dir: "azure-developer-signing-rest"
generateMetadata: true
generateTest: true
packageDetails:
name: "@azure-rest/azure-codesigning-rest"
description: "Azure Codesigning Service"
name: "@azure-rest/developer-signing"
description: "Azure developer signing service"
"@azure-tools/typespec-java":
package-dir: "azure-codesigning"
namespace: com.azure.codesigning
package-dir: "com.azure.developer.signing"
namespace: Azure.Developer.Signing
Loading