{ "info": { "_postman_id": "19febf47-bdbe-4180-b40e-1448664cadcf", "name": "Seismic DDMS", "description": "Exploring Authorization API in OSDU. This collection allows doing the following requests:\n\n1) Getting access and id tokens (aihtorization code flow)\n2) Discover OpenID Connect configuration\n3) Refreshing tokens\n4) Making secured User Info request (to validate the token)", "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json", "_exporter_id": "28759361" }, "item": [ { "name": "Setup", "item": [ { "name": "Get an SPN Token", "event": [ { "listen": "test", "script": { "exec": [ "cp = pm.environment.get(\"cloud_platform\");\r", "\r", "var data = JSON.parse(responseBody)\r", "pm.environment.set(\"access_token\", data.access_token);\r", "\r", "// Uncomment if server returns a new refresh_token,\r", "// otherwise comment out to prevent overwriting it with null\r", "if (cp == \"Azure\") {\r", " pm.environment.set(\"refresh_token\", data.refresh_token);\r", "}\r", "\r", "pm.test(\"Status code is 200\", function () {\r", " pm.response.to.have.status(200);\r", "});" ], "type": "text/javascript" } } ], "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [], "body": { "mode": "urlencoded", "urlencoded": [ { "key": "grant_type", "value": "client_credentials", "type": "text" }, { "key": "client_id", "value": "{{client_id}}", "type": "text" }, { "key": "client_secret", "value": "{{client_secret}}", "type": "text" }, { "key": "scope", "value": "{{scope}}", "type": "text" } ] }, "url": "https://login.microsoftonline.com/{{tenant_id}}/oauth2/v2.0/token" }, "response": [] }, { "name": "Create Legal Tag for SDMS", "event": [ { "listen": "prerequest", "script": { "exec": [ "var rand = _.random(999111111111, 999999999999);\r", "var dataPartition = pm.environment.get(\"data_partition_id\");\r", "pm.environment.set(\"tag_name\", \"Seismic-Legal-Tag-Test\" + rand);" ], "type": "text/javascript" } }, { "listen": "test", "script": { "exec": [ "// Tags should be added or already exists", "pm.test(\"Status code is 201 or 409\", function () {", " pm.expect(pm.response.code).to.be.oneOf([201,409]);", "});", "", "var jsonData = pm.response.json();", "pm.environment.set(\"legal_tag\", jsonData.name);" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Data-Partition-Id", "value": "{{data_partition_id}}", "type": "text" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"{{tag_name}}\",\n \"description\": \"Legal Tag added for Seismic\",\n \"properties\": {\n \"countryOfOrigin\": [\n \"US\"\n ],\n \"contractId\": \"No Contract Related\",\n \"expirationDate\": \"2099-01-01\",\n \"dataType\": \"Public Domain Data\",\n \"originator\": \"OSDU\",\n \"securityClassification\": \"Public\",\n \"exportClassification\": \"EAR99\",\n \"personalData\": \"No Personal Data\"\n }\n}", "options": { "raw": { "language": "json" } } }, "url": "{{base_url}}/{{legal_api}}/legaltags" }, "response": [] } ] }, { "name": "Seismic DDMS", "item": [ { "name": "Service Verification", "item": [ { "name": "Check Readines", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {\r", " pm.expect(pm.response.code).to.be.oneOf([200]);\r", "});\r", "\r", "pm.test(\"Have valid body\", function () {\r", " let json = pm.response.json();\r", " pm.expect(json.ready).to.be.equal(true);\r", "});" ], "type": "text/javascript" } } ], "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "method": "GET", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "key": "data-partition-id", "type": "text", "value": "{{data_partition_id}}" }, { "description": "Legal tag of the dataset", "key": "ltag", "type": "text", "value": "opendes-public-usa-dataset-1", "disabled": true } ], "body": { "mode": "raw", "raw": "" }, "url": "{{base_url}}/{{seismic_api}}/svcstatus/readiness" }, "response": [] }, { "name": "Check Access", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {\r", " pm.expect(pm.response.code).to.be.oneOf([200]);\r", "});\r", "\r", "pm.test(\"Have valid body\", function () {\r", " let json = pm.response.json();\r", " pm.expect(json.status).to.be.equal('running');\r", "});" ], "type": "text/javascript" } } ], "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "method": "GET", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "key": "data-partition-id", "type": "text", "value": "{{data_partition_id}}" }, { "description": "Legal tag of the dataset", "key": "ltag", "type": "text", "value": "opendes-public-usa-dataset-1", "disabled": true } ], "body": { "mode": "raw", "raw": "" }, "url": "{{base_url}}/{{seismic_api}}/svcstatus/access" }, "response": [] }, { "name": "Check Status", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {\r", " pm.expect(pm.response.code).to.be.oneOf([200]);\r", "});\r", "\r", "pm.test(\"Have valid body\", function () {\r", " let text = pm.response.text();\r", " pm.expect(text).to.be.equal('service OK');\r", "});" ], "type": "text/javascript" } } ], "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "method": "GET", "header": [ { "key": "Content-Type", "type": "text", "value": "application/json" }, { "key": "data-partition-id", "type": "text", "value": "{{data_partition_id}}" }, { "description": "Legal tag of the dataset", "key": "ltag", "type": "text", "value": "opendes-public-usa-dataset-1", "disabled": true } ], "body": { "mode": "raw", "raw": "" }, "url": "{{base_url}}/{{seismic_api}}/svcstatus" }, "response": [] } ] }, { "name": "Tenant", "item": [ { "name": "Register a seismic-dms tenant", "event": [ { "listen": "prerequest", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Accept", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"gcpid\": \"{{seismic_project}}\",\n \"esd\": \"{{data_partition_id}}{{domain}}\",\n \"default_acl\": \"users.datalake.admins@{{data_partition_id}}{{domain}}\"\n}", "options": { "raw": { "language": "json" } } }, "url": "{{base_url}}/{{seismic_api}}/tenant/{{seismic_project}}", "description": "