Skip to content
Draft
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
2 changes: 2 additions & 0 deletions .github/workflows/sync-server-side-sdks-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ jobs:
language: python
language-version: '3.12'
generate-command: 'bash ./generate.sh'
schema-source: fingerprint-server-api-v4-flat.yaml
schema-path: res/fingerprint-server-api.yaml
examples-path: test/mocks
app-id: ${{ vars.RUNNER_APP_ID }}
Expand Down Expand Up @@ -152,6 +153,7 @@ jobs:
language: php
language-version: '8.3'
generate-command: 'bash ./scripts/generate.sh'
schema-source: fingerprint-server-api-v4-flat.yaml
schema-path: res/fingerprint-server-api.yaml
examples-path: test/mocks
app-id: ${{ vars.RUNNER_APP_ID }}
Expand Down
351 changes: 351 additions & 0 deletions utils/mocks/publishedEvent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,351 @@
type: object
description: Contains results from Fingerprint Identification and all active Smart Signals. Some Smart Signals are only supported for certain device types, these fields will be omitted for events not generated from the supported devices. Consult the [Smart Signals reference](https://docs.fingerprint.com/docs/smart-signals-reference) for more details.
additionalProperties: false
required:
- event_id
- timestamp
properties:
event_id:
$ref: platform/EventId.yaml
x-platforms:
- android
- ios
- browser
timestamp:
$ref: platform/Timestamp.yaml
x-platforms:
- android
- ios
- browser
source:
$ref: platform/EventSource.yaml
x-platforms:
- android
- ios
- browser
incremental_identification_status:
$ref: platform/IncrementalIdentificationStatus.yaml
x-platforms:
- browser
linked_id:
$ref: platform/LinkedId.yaml
x-platforms:
- android
- ios
- browser
environment_id:
$ref: platform/EnvironmentId.yaml
x-platforms:
- android
- ios
- browser
suspect:
$ref: platform/Suspect.yaml
x-platforms:
- android
- ios
- browser
sdk:
$ref: platform/SDK.yaml
x-platforms:
- android
- ios
- browser
replayed:
$ref: platform/Replayed.yaml
x-platforms:
- android
- ios
- browser
triggered_by:
$ref: platform/webhook/TriggeredBy.yaml
identification:
$ref: identification/Identification.yaml
x-platforms:
- android
- ios
- browser
supplementary_id_high_recall:
$ref: identification/SupplementaryIDHighRecall.yaml
x-platforms:
- android
- ios
- browser
tags:
$ref: identification/Tags.yaml
x-platforms:
- android
- ios
- browser
url:
$ref: identification/Url.yaml
x-platforms:
- browser
bundle_id:
$ref: identification/BundleId.yaml
x-platforms:
- ios
package_name:
$ref: identification/PackageName.yaml
x-platforms:
- android
ip_address:
$ref: identification/IpAddress.yaml
x-platforms:
- android
- ios
- browser
user_agent:
$ref: identification/UserAgent.yaml
x-platforms:
- android
- ios
- browser
device:
$ref: identification/Device.yaml
x-platforms:
- android
- ios
- browser
os:
$ref: identification/Os.yaml
x-platforms:
- android
- ios
- browser
os_version:
$ref: identification/OsVersion.yaml
x-platforms:
- android
- ios
- browser
client_referrer:
$ref: identification/ClientReferrer.yaml
x-platforms:
- browser
browser_details:
$ref: identification/BrowserDetails.yaml
x-platforms:
- browser
proximity:
$ref: identification/Proximity.yaml
x-platforms:
- android
- ios
- browser
active_call:
$ref: smartsignals/ActiveCall.yaml
x-platforms:
- android
- ios
bot:
$ref: smartsignals/BotResult.yaml
x-platforms:
- browser
bot_type:
$ref: smartsignals/BotType.yaml
x-platforms:
- browser
bot_info:
$ref: smartsignals/BotInfo.yaml
x-platforms:
- browser
cloned_app:
$ref: smartsignals/ClonedApp.yaml
x-platforms:
- android
developer_tools:
$ref: smartsignals/DeveloperTools.yaml
x-platforms:
- browser
- android
- ios
device_details:
$ref: smartsignals/DeviceDetails.yaml
x-platforms:
- android
- ios
emulator:
$ref: smartsignals/Emulator.yaml
x-platforms:
- android
factory_reset_timestamp:
$ref: smartsignals/FactoryReset.yaml
x-platforms:
- android
- ios
frida:
$ref: smartsignals/Frida.yaml
x-platforms:
- android
- ios
ip_blocklist:
$ref: smartsignals/IPBlockList.yaml
x-platforms:
- android
- ios
- browser
ip_info:
$ref: smartsignals/IPInfo.yaml
x-platforms:
- android
- ios
- browser
proxy:
$ref: smartsignals/Proxy.yaml
x-platforms:
- android
- ios
- browser
proxy_confidence:
$ref: smartsignals/ProxyConfidence.yaml
x-platforms:
- android
- ios
- browser
proxy_details:
$ref: smartsignals/ProxyDetails.yaml
x-platforms:
- android
- ios
- browser
proxy_ml_score:
$ref: smartsignals/ProxyMLScore.yaml
x-platforms:
- browser
incognito:
$ref: smartsignals/Incognito.yaml
x-platforms:
- browser
jailbroken:
$ref: smartsignals/Jailbroken.yaml
x-platforms:
- ios
location_spoofing:
$ref: smartsignals/LocationSpoofing.yaml
x-platforms:
- android
- ios
mitm_attack:
$ref: smartsignals/MitMAttack.yaml
x-platforms:
- android
- ios
privacy_settings:
$ref: smartsignals/PrivacySettings.yaml
x-platforms:
- browser
root_apps:
$ref: smartsignals/RootApps.yaml
x-platforms:
- android
rule_action:
$ref: platform/EventRuleAction.yaml
simulator:
$ref: smartsignals/Simulator.yaml
x-platforms:
- ios
suspect_score:
$ref: smartsignals/SuspectScore.yaml
x-platforms:
- android
- ios
- browser
tampering:
$ref: smartsignals/Tampering.yaml
x-platforms:
- android
- ios
- browser
tampering_confidence:
$ref: smartsignals/TamperingConfidence.yaml
x-platforms:
- android
- ios
- browser
tampering_ml_score:
$ref: smartsignals/TamperingMlScore.yaml
x-platforms:
- android
- ios
- browser
tampering_details:
$ref: smartsignals/TamperingDetails.yaml
x-platforms:
- android
- ios
- browser
velocity:
$ref: smartsignals/Velocity.yaml
x-platforms:
- android
- ios
- browser
virtual_machine:
$ref: smartsignals/VirtualMachine.yaml
x-platforms:
- browser
virtual_machine_ml_score:
$ref: smartsignals/VirtualMachineMLScore.yaml
x-platforms:
- browser
vpn:
$ref: smartsignals/Vpn.yaml
x-platforms:
- android
- ios
- browser
vpn_confidence:
$ref: smartsignals/VpnConfidence.yaml
x-platforms:
- android
- ios
- browser
vpn_ml_score:
$ref: smartsignals/VpnMLScore.yaml
x-platforms:
- browser
vpn_origin_timezone:
$ref: smartsignals/VpnOriginTimezone.yaml
x-platforms:
- android
- ios
- browser
vpn_origin_country:
$ref: smartsignals/VpnOriginCountry.yaml
x-platforms:
- android
- ios
- browser
vpn_methods:
$ref: smartsignals/VpnMethods.yaml
x-platforms:
- android
- ios
- browser
high_activity_device:
$ref: smartsignals/HighActivity.yaml
x-platforms:
- android
- ios
- browser
rare_device:
$ref: smartsignals/RareDevice.yaml
x-platforms:
- browser
rare_device_percentile_bucket:
$ref: smartsignals/RareDevicePercentileBucket.yaml
x-platforms:
- browser
raw_device_attributes:
$ref: smartsignals/RawDeviceAttributes.yaml
x-platforms:
- browser
- ios
- android
labels:
$ref: smartsignals/Labels.yaml
x-platforms:
- browser
- ios
- android
26 changes: 26 additions & 0 deletions utils/replaceOneOf.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,4 +455,30 @@ describe('Test replaceOneOf', () => {

expect(schema.additionalProperties).toBe(true);
});

it('keeps x-platforms from an earlier variant when a later variant omits them', () => {
const schema: OpenApiDocument = {
oneOf: [
{
type: 'object',
properties: {
url: { type: 'string', 'x-platforms': ['browser'] },
tags: { type: 'object', 'x-platforms': ['browser'] },
},
},
{
type: 'object',
properties: {
url: { type: 'string' },
tags: { type: 'object', 'x-platforms': ['ios'] },
},
},
],
};

replaceOneOf(schema, {}, 'oneOf');

expect(schema.properties.url['x-platforms']).toEqual(['browser']);
expect(schema.properties.tags['x-platforms']).toEqual(['ios']);
});
});
Loading
Loading