From fb66302ddbe060ebd517108e1bfe129b454d6a53 Mon Sep 17 00:00:00 2001 From: lostlevels Date: Thu, 31 Aug 2023 11:20:51 -0700 Subject: [PATCH] Update api for palmtree. --- reference/auth/models/assertionsecret.v1.yaml | 24 ++++------------ reference/auth/models/assertionverify.v1.yaml | 9 ++++-- .../auth/models/attestationverify.v1.yaml | 4 +-- ...taldata.v1.yaml => coastalrequest.v1.yaml} | 14 +++------- reference/auth/models/coastalresponse.v1.yaml | 21 ++++++++++++++ reference/auth/models/keyid.v1.yaml | 3 +- reference/auth/models/newappchallenge.v1.yaml | 3 +- reference/auth/models/palmtreerequest.v1.yaml | 5 ++++ .../auth/models/palmtreeresponse.v1.yaml | 28 +++++++++++++++++++ 9 files changed, 76 insertions(+), 35 deletions(-) rename reference/auth/models/{coastaldata.v1.yaml => coastalrequest.v1.yaml} (61%) create mode 100644 reference/auth/models/coastalresponse.v1.yaml create mode 100644 reference/auth/models/palmtreerequest.v1.yaml create mode 100644 reference/auth/models/palmtreeresponse.v1.yaml diff --git a/reference/auth/models/assertionsecret.v1.yaml b/reference/auth/models/assertionsecret.v1.yaml index 72e2b59a..286cf16b 100644 --- a/reference/auth/models/assertionsecret.v1.yaml +++ b/reference/auth/models/assertionsecret.v1.yaml @@ -1,20 +1,8 @@ -title: AssertionSecret -description: Data sent back upon successful app assertion. This will include X.509 certificates. +title: Assertion Secret +description: Data sent back upon successful app assertion. type: object properties: - certificates: - description: X.509 certificates to be used for client authentication. - type: array - items: - type: object - properties: - content: - $ref: '../../common/models/base64.v1.yaml' - description: base64 encoded X.509 certificate in DER format. - ttlInDays: - type: integer - type: - type: string - enum: - - CONSTRAINED - - WILDCARD \ No newline at end of file + data: + oneOf: + - $ref: './coastalresponse.v1.yaml' + - $ref: './palmtreeresponse.v1.yaml' \ No newline at end of file diff --git a/reference/auth/models/assertionverify.v1.yaml b/reference/auth/models/assertionverify.v1.yaml index e2704982..d27f23a1 100644 --- a/reference/auth/models/assertionverify.v1.yaml +++ b/reference/auth/models/assertionverify.v1.yaml @@ -3,7 +3,8 @@ description: Request body for verifying an assertion. type: object properties: assertion: - $ref: '../../common/models/base64.v1.yaml' + type: string + pattern: '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$' description: Base64 encoded data received from Apple App Attest API. User must base64 encode the binary data received from Apple. clientData: type: object @@ -18,9 +19,11 @@ properties: minLength: 1 enum: - Coastal + - PalmTree partnerData: - description: Actual data to send to partner API. - $ref: './coastaldata.v1.yaml' + oneOf: + - $ref: './coastalrequest.v1.yaml' + - $ref: './palmtreerequest.v1.yaml' description: Actual data requested by client. Must include the previously requested challenge. keyId: $ref: './keyid.v1.yaml' diff --git a/reference/auth/models/attestationverify.v1.yaml b/reference/auth/models/attestationverify.v1.yaml index ab215daa..6a785352 100644 --- a/reference/auth/models/attestationverify.v1.yaml +++ b/reference/auth/models/attestationverify.v1.yaml @@ -3,7 +3,8 @@ description: Request body for verifying an attestation. type: object properties: attestation: - $ref: '../../common/models/base64.v1.yaml' + type: string + pattern: '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$' description: Base64 encoded data received from Apple App Attest API. User must base64 encode the binary data received from Apple. challenge: type: string @@ -11,7 +12,6 @@ properties: description: The previously returned attestation challenge. keyId: $ref: './keyid.v1.yaml' - description: Base64 encoded key Id received from Apple App Attest API. required: - attestation - challenge diff --git a/reference/auth/models/coastaldata.v1.yaml b/reference/auth/models/coastalrequest.v1.yaml similarity index 61% rename from reference/auth/models/coastaldata.v1.yaml rename to reference/auth/models/coastalrequest.v1.yaml index 2183ddb2..25ef8f9e 100644 --- a/reference/auth/models/coastaldata.v1.yaml +++ b/reference/auth/models/coastalrequest.v1.yaml @@ -1,10 +1,7 @@ -title: CoastalData +title: Coastal Request Data description: Data to send to Coastal's API. type: object properties: - rcTypeId: - type: string - minLength: 1 rcInstanceId: type: string minLength: 1 @@ -23,10 +20,7 @@ properties: type: string minLength: 1 csr: - $ref: '../../common/models/base64.v1.yaml' - description: Base64 encoded string of the PEM formatted certificate signing request to the partner API. - minLength: 1 - rcbMac: type: string - description: Deprecated field that will be removed in the future but currently required by partner. Value can be any non empty string. - minLength: 1 + pattern: '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$' + description: Base64 encoded string of the PEM formatted certificate signing request to the partner API. + minLength: 1 \ No newline at end of file diff --git a/reference/auth/models/coastalresponse.v1.yaml b/reference/auth/models/coastalresponse.v1.yaml new file mode 100644 index 00000000..478cf285 --- /dev/null +++ b/reference/auth/models/coastalresponse.v1.yaml @@ -0,0 +1,21 @@ +title: Coastal Response +description: Data retrieved from Coastal's API. +type: object +properties: + certificates: + description: X.509 certificates to be used for client authentication. + type: array + items: + type: object + properties: + content: + type: string + pattern: '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$' + description: base64 encoded X.509 certificate in DER format. + ttlInDays: + type: integer + type: + type: string + enum: + - CONSTRAINED + - WILDCARD \ No newline at end of file diff --git a/reference/auth/models/keyid.v1.yaml b/reference/auth/models/keyid.v1.yaml index 59fbd1f2..248a7f91 100644 --- a/reference/auth/models/keyid.v1.yaml +++ b/reference/auth/models/keyid.v1.yaml @@ -1,3 +1,4 @@ title: Key Id description: Base64 encoded key identifier received from apple. The Key Id is some shortened data, usually a hash, used to identify the longer actual key. -$ref: '../../common/models/base64.v1.yaml' +type: string +pattern: '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$' diff --git a/reference/auth/models/newappchallenge.v1.yaml b/reference/auth/models/newappchallenge.v1.yaml index 2f0c2014..b8001001 100644 --- a/reference/auth/models/newappchallenge.v1.yaml +++ b/reference/auth/models/newappchallenge.v1.yaml @@ -3,7 +3,8 @@ description: Information needed when generating an attestation or assertion chal type: object properties: keyId: - $ref: '../../common/models/base64.v1.yaml' + type: string + pattern: '^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$' description: Base64 encoded key Id received from Apple App Attest API. required: - keyId diff --git a/reference/auth/models/palmtreerequest.v1.yaml b/reference/auth/models/palmtreerequest.v1.yaml new file mode 100644 index 00000000..0722ac63 --- /dev/null +++ b/reference/auth/models/palmtreerequest.v1.yaml @@ -0,0 +1,5 @@ +title: Palm Tree Request Data +description: Data to send to Palm Tree's API. +type: object +properties: +- name: csr \ No newline at end of file diff --git a/reference/auth/models/palmtreeresponse.v1.yaml b/reference/auth/models/palmtreeresponse.v1.yaml new file mode 100644 index 00000000..3c7fd439 --- /dev/null +++ b/reference/auth/models/palmtreeresponse.v1.yaml @@ -0,0 +1,28 @@ +title: Palm Tree Response +description: Data retrieved from Palm Tree's API. +type: object +properties: + type: + type: string + Enrolment: + type: object + properties: + body: + type: string + description: PEM encoded certificate. + id: + type: string + issuerName: + type: string + serialNumber: + type: string + subjectName: + type: string + id: + type: string + serialNumber: + type: string + status: + type: string + validityPeriod: + type: string \ No newline at end of file