{ "swagger": "2.0", "info": { "title": "Microsoft Code Transparency Service", "version": "2024-01-11-preview", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "x-ms-parameterized-host": { "hostTemplate": "{endpoint}", "useSchemePrefix": false, "parameters": [ { "name": "endpoint", "in": "path", "required": true, "type": "string", "format": "uri", "x-ms-skip-url-encoding": true } ] }, "produces": [ "application/json" ], "consumes": [ "application/json" ], "tags": [], "paths": { "/.well-known/did.json": { "get": { "operationId": "GetDidConfig", "description": "Get the DID configuration file (deprecated)", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/DidDocument" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "GetDidConfig": { "$ref": "./examples/GetDidConfig.json" } } } }, "/configuration": { "get": { "operationId": "GetCodeTransparencyConfig", "description": "Get CodeTransparency configuration information.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/CodeTransparencyConfiguration" } }, "500": { "description": "Server error response", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } }, "503": { "description": "Service temporarily unavailable", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "Retry-After": { "type": "string", "description": "Retry the same request after a suggested number of seconds" }, "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } }, "x-ms-error-response": true } }, "x-ms-examples": { "GetCodeTransparencyConfig": { "$ref": "./examples/GetCodeTransparencyConfig.json" } } } }, "/entries": { "post": { "operationId": "CreateEntryDeprecated", "description": "Post an entry to be registered on the CodeTransparency instance (deprecated)", "consumes": [ "application/cose" ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "$ref": "#/parameters/SignedStatement.body" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/CreateEntryResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "CreateEntryDeprecated": { "$ref": "./examples/CreateEntryDeprecated.json" } } } }, "/entries/{entryId}": { "get": { "operationId": "GetEntryDeprecated", "description": "Get signed statement with or without receipt embedded in its unprotected header", "produces": [ "application/cose", "application/json" ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "$ref": "#/parameters/EntryIdParameter" }, { "$ref": "#/parameters/EmbedReceiptParameter" } ], "responses": { "200": { "description": "Signed statement", "schema": { "type": "file" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "GetEntryDeprecated": { "$ref": "./examples/GetEntryDeprecated.json" } } } }, "/entries/{entryId}/receipt": { "get": { "operationId": "GetEntryReceiptDeprecated", "description": "Get the receipt of an entry given a specific entry id.", "produces": [ "application/cbor", "application/json" ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "$ref": "#/parameters/EntryIdParameter" } ], "responses": { "200": { "description": "A ledger receipt, see IETF SCITT draft", "schema": { "type": "file" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "GetEntryReceiptDeprecated": { "$ref": "./examples/GetEntryReceiptDeprecated.json" } } } }, "/entries/txIds": { "get": { "operationId": "ListEntryIds", "description": "Historical query to get a list of entries of a given range", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "$ref": "#/parameters/TransactionsRange.from" }, { "$ref": "#/parameters/TransactionsRange.to" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/EntryIds" } }, "500": { "description": "Server error response", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } }, "503": { "description": "Service temporarily unavailable", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "Retry-After": { "type": "string", "description": "Retry the same request after a suggested number of seconds" }, "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } }, "x-ms-error-response": true } }, "x-ms-examples": { "ListEntryIds": { "$ref": "./examples/ListEntryIds.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink", "itemName": "transactionIds" } } }, "/operations": { "get": { "operationId": "ListEntryStatuses", "description": "Get the status of all entries operations (deprecated)", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ListOperationResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "ListEntryStatuses": { "$ref": "./examples/ListEntryStatuses.json" } } } }, "/operations/{operationId}": { "get": { "operationId": "GetEntryStatus", "description": "Get the status the entry operation (deprecated)", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "$ref": "#/parameters/OperationIdParameter" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/GetOperationResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "GetEntryStatus": { "$ref": "./examples/GetEntryStatus.json" } } } }, "/parameters": { "get": { "operationId": "GetParameters", "description": "Get service parameters (deprecated)", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ParametersResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "GetParameters": { "$ref": "./examples/GetParameters.json" } } } }, "/version": { "get": { "operationId": "GetCodeTransparencyVersion", "description": "Get CodeTransparency version information.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/VersionResult" } }, "500": { "description": "Server error response", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } }, "503": { "description": "Service temporarily unavailable", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "Retry-After": { "type": "string", "description": "Retry the same request after a suggested number of seconds" }, "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } }, "x-ms-error-response": true } }, "x-ms-examples": { "GetCodeTransparencyVersion": { "$ref": "./examples/GetCodeTransparencyVersion.json" } } } } }, "definitions": { "AcceptCborHeader": { "type": "object", "description": "Accept application/cbor header" }, "AcceptCoseHeader": { "type": "object", "description": "Accept application/cose header" }, "AcceptJsonHeader": { "type": "object", "description": "Accept application/json header" }, "Azure.Core.Foundations.Error": { "type": "object", "description": "The error object.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error." }, "details": { "type": "array", "description": "An array of details about specific errors that led to this reported error.", "items": { "$ref": "#/definitions/Azure.Core.Foundations.Error" }, "x-ms-identifiers": [] }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "An object containing more specific information than the current object about the error." } }, "required": [ "code", "message" ] }, "Azure.Core.Foundations.ErrorResponse": { "type": "object", "description": "A response containing error details.", "properties": { "error": { "$ref": "#/definitions/Azure.Core.Foundations.Error", "description": "The error object." } }, "required": [ "error" ] }, "Azure.Core.Foundations.InnerError": { "type": "object", "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "Inner error." } } }, "CodeTransparencyConfiguration": { "type": "object", "description": "The Response body of the Configuration API.", "properties": { "policy": { "$ref": "#/definitions/CodeTransparencyConfigurationPolicy", "description": "Policy configuration" }, "authentication": { "$ref": "#/definitions/CodeTransparencyConfigurationAuthentication", "description": "Authentication configuration" }, "service_identifier": { "type": "string", "description": "Issuer used in receipts" } } }, "CodeTransparencyConfigurationAuthentication": { "type": "object", "description": "Configuration of CCF authentication.", "properties": { "allow_unauthenticated": { "type": "boolean", "description": "Disable API authentication and rely on signed statement verification only" }, "jwt": { "$ref": "#/definitions/CodeTransparencyConfigurationAuthenticationJwt", "description": "JWT requirements if authentication is enabled" } }, "required": [ "allow_unauthenticated" ] }, "CodeTransparencyConfigurationAuthenticationJwt": { "type": "object", "description": "Configuration of JWT claims", "properties": { "required_claims": { "type": "object", "description": "Claims that must be present in the JWT", "additionalProperties": { "type": "string" } } }, "required": [ "required_claims" ] }, "CodeTransparencyConfigurationPolicy": { "type": "object", "description": "Policy configuration listing accepted algorithms and the the policy script", "properties": { "accepted_algorithms": { "type": "array", "description": "Accepted COSE signature algorithms when verifying signed statements", "items": { "type": "string" } }, "accepted_did_issuers": { "type": "array", "description": "Accepted COSE signature did:web issuers when verifying signed statements", "items": { "type": "string" } } } }, "CreateEntryResult": { "type": "object", "description": "Response of entry submission containing the operationId.", "properties": { "operationId": { "type": "string", "description": "String representing the operation id submitted", "pattern": "^[0-9]+\\.[0-9]+$" } }, "required": [ "operationId" ] }, "DidDocument": { "type": "object", "description": "A DID document", "properties": { "id": { "type": "string", "description": "String representing a DID issuer." }, "assertionMethod": { "type": "array", "description": "List of public keys used for receipt endorsement verification.", "items": { "$ref": "#/definitions/DidDocumentKey" } } }, "required": [ "id", "assertionMethod" ] }, "DidDocumentKey": { "type": "object", "description": "A DID document key", "properties": { "id": { "type": "string", "description": "Key identifier." }, "controller": { "type": "string", "description": "Key controller - similar to DID issuer." }, "type": { "type": "string", "description": "Key type.", "enum": [ "JsonWebKey2020" ], "x-ms-enum": { "modelAsString": false } }, "publicKeyJwk": { "$ref": "#/definitions/JsonWebKey", "description": "Serialized public key in JWK format." } }, "required": [ "id", "controller", "type", "publicKeyJwk" ] }, "DidIssuer": { "type": "object", "description": "A DID issuer", "properties": { "issuer": { "type": "string", "description": "String representing a DID issuer." } }, "required": [ "issuer" ] }, "EntryIds": { "type": "object", "description": "A List of Entry IDs", "properties": { "transactionIds": { "type": "array", "description": "List of entry ids", "items": { "type": "string" } }, "nextLink": { "type": "string", "description": "Path to the next page of results" } }, "required": [ "transactionIds" ] }, "GetOperationResult": { "type": "object", "description": "The Response body of the GetOperationId API.", "properties": { "entryId": { "type": "string", "description": "ID of the transaction. Only if status is Succeeded.", "pattern": "^[0-9]+\\.[0-9]+$" }, "error": { "type": "string", "description": "Error in json format. Only if Status is Failed." }, "operationId": { "type": "string", "description": "OperationId", "pattern": "^[0-9]+\\.[0-9]+$" }, "status": { "$ref": "#/definitions/OperationStatus", "description": "Status of the operation." } }, "required": [ "operationId", "status" ] }, "JsonWebKey": { "type": "object", "description": "rfc7517 JSON Web Key representation adapted from a shared swagger definition in the common types", "properties": { "alg": { "type": "string", "description": "The \"alg\" (algorithm) parameter identifies the algorithm intended for\nuse with the key. The values used should either be registered in the\nIANA \"JSON Web Signature and Encryption Algorithms\" registry\nestablished by [JWA] or be a value that contains a Collision-\nResistant Name." }, "crv": { "type": "string", "description": "The \"crv\" (curve) parameter identifies the curve type" }, "d": { "type": "string", "description": "RSA private exponent or ECC private key" }, "dp": { "type": "string", "description": "RSA Private Key Parameter" }, "dq": { "type": "string", "description": "RSA Private Key Parameter" }, "e": { "type": "string", "description": "RSA public exponent, in Base64" }, "k": { "type": "string", "description": "Symmetric key" }, "kid": { "type": "string", "description": "The \"kid\" (key ID) parameter is used to match a specific key. This\nis used, for instance, to choose among a set of keys within a JWK Set\nduring key rollover. The structure of the \"kid\" value is\nunspecified. When \"kid\" values are used within a JWK Set, different\nkeys within the JWK Set SHOULD use distinct \"kid\" values. (One\nexample in which different keys might use the same \"kid\" value is if\nthey have different \"kty\" (key type) values but are considered to be\nequivalent alternatives by the application using them.) The \"kid\"\nvalue is a case-sensitive string." }, "kty": { "type": "string", "description": "The \"kty\" (key type) parameter identifies the cryptographic algorithm\nfamily used with the key, such as \"RSA\" or \"EC\". \"kty\" values should\neither be registered in the IANA \"JSON Web Key Types\" registry\nestablished by [JWA] or be a value that contains a Collision-\nResistant Name. The \"kty\" value is a case-sensitive string." }, "n": { "type": "string", "description": "RSA modulus, in Base64" }, "p": { "type": "string", "description": "RSA secret prime" }, "q": { "type": "string", "description": "RSA secret prime, with p < q" }, "qi": { "type": "string", "description": "RSA Private Key Parameter" }, "use": { "type": "string", "description": "Use (\"public key use\") identifies the intended use of\nthe public key. The \"use\" parameter is employed to indicate whether\na public key is used for encrypting data or verifying the signature\non data. Values are commonly \"sig\" (signature) or \"enc\" (encryption)." }, "x": { "type": "string", "description": "X coordinate for the Elliptic Curve point" }, "x5c": { "type": "array", "description": "The \"x5c\" (X.509 certificate chain) parameter contains a chain of one\nor more PKIX certificates [RFC5280]. The certificate chain is\nrepresented as a JSON array of certificate value strings. Each\nstring in the array is a base64-encoded (Section 4 of [RFC4648] --\nnot base64url-encoded) DER [ITU.X690.1994] PKIX certificate value.\nThe PKIX certificate containing the key value MUST be the first\ncertificate.", "items": { "type": "string" } }, "y": { "type": "string", "description": "Y coordinate for the Elliptic Curve point" } }, "required": [ "kty" ] }, "ListOperationResult": { "type": "object", "description": "The Response body of the ListOperations API", "properties": { "operations": { "type": "array", "description": "List of operations", "items": { "$ref": "#/definitions/GetOperationResult" }, "x-ms-identifiers": [] } }, "required": [ "operations" ] }, "NotFoundErrorJsonResponse": { "type": "object", "description": "Not found error response", "properties": { "error": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse", "description": "Error response" } }, "required": [ "error" ] }, "OperationStatus": { "type": "string", "description": "Possible statuses of the operation.", "enum": [ "running", "failed", "succeeded" ], "x-ms-enum": { "name": "OperationStatus", "modelAsString": true, "values": [ { "name": "running", "value": "running", "description": "Operation is still running." }, { "name": "failed", "value": "failed", "description": "Operation failed." }, { "name": "succeeded", "value": "succeeded", "description": "Operation succeeded." } ] } }, "ParametersResult": { "type": "object", "description": "The Response body of the service parameters", "properties": { "serviceCertificate": { "type": "string", "description": "Service certificate used in TLS and for receipt verification" }, "serviceId": { "type": "string", "description": "Service identifier" }, "signatureAlgorithm": { "type": "string", "description": "Signature algorithm used in receipts" }, "treeAlgorithm": { "type": "string", "description": "Tree algorithm used in receipts" } }, "required": [ "serviceCertificate", "serviceId", "signatureAlgorithm", "treeAlgorithm" ] }, "ReceiptEntry": { "type": "object", "description": "A ledger receipt, see IETF SCITT draft", "properties": { "body": { "type": "string", "format": "byte", "description": "A raw CBOR content" } }, "required": [ "body" ] }, "ServerErrorJsonResponse": { "type": "object", "description": "Server error response", "properties": { "error": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse", "description": "Error response" } }, "required": [ "error" ] }, "ServiceUnavailableError": { "type": "object", "description": "Service temporarily unavailable", "properties": { "error": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse", "description": "Error response" } }, "required": [ "error" ] }, "TransparentStatement": { "type": "object", "description": "Transparent statement", "properties": { "body": { "type": "string", "format": "byte", "description": "CoseSign1 signature envelope with the receipt embedded in the unprotected header" } }, "required": [ "body" ] }, "ValidationErrorJsonResponse": { "type": "object", "description": "Validation error response", "properties": { "error": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse", "description": "Error response" } }, "required": [ "error" ] }, "VersionResult": { "type": "object", "description": "The Response body of the Version API.", "properties": { "scitt_version": { "type": "string", "description": "Version of the CodeTransparency service" } }, "required": [ "scitt_version" ] } }, "parameters": { "Azure.Core.Foundations.ApiVersionParameter": { "name": "api-version", "in": "query", "description": "The API version to use for this operation.", "required": true, "type": "string", "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" }, "EmbedReceiptParameter": { "name": "embedReceipt", "in": "query", "description": "Embed a receipt as part of the response", "required": false, "type": "boolean", "default": false, "x-ms-parameter-location": "method" }, "EntryIdParameter": { "name": "entryId", "in": "path", "description": "ID of the entry to retrieve.", "required": true, "type": "string", "maxLength": 100, "pattern": "^[0-9]+\\.[0-9]+$", "x-ms-parameter-location": "method" }, "OperationIdParameter": { "name": "operationId", "in": "path", "description": "ID of the operation to retrieve.", "required": true, "type": "string", "pattern": "^[0-9]+\\.[0-9]+$", "x-ms-parameter-location": "method" }, "SignedStatement.body": { "name": "body", "in": "body", "description": "CoseSign1 signature envelope", "required": true, "schema": { "type": "string", "format": "binary" }, "x-ms-parameter-location": "method" }, "TransactionsRange.from": { "name": "from", "in": "query", "description": "Starting Transaction Id", "required": false, "type": "integer", "format": "int64", "minimum": 0, "x-ms-parameter-location": "method" }, "TransactionsRange.to": { "name": "to", "in": "query", "description": "Ending Transaction Id", "required": false, "type": "integer", "format": "int64", "minimum": 0, "x-ms-parameter-location": "method" } } }