{ "opencollection": "1.0.0", "info": { "name": "Socket alerts license-policy API", "version": "0" }, "items": [ { "info": { "name": "license-policy", "type": "folder" }, "items": [ { "info": { "name": "License Metadata", "type": "http" }, "http": { "method": "POST", "url": "https://api.socket.dev/v0/license-metadata", "params": [ { "name": "includetext", "value": "", "type": "query", "description": "If `true`, the response will include the full text of the requested licenses" } ], "body": { "type": "json", "data": "{}" } }, "docs": "For an array of license identifiers or names (short form SPDX identifiers, or long form license names),\n returns an array of metadata for the corresponding license, if the license is recognized. If the query\n parameter `includetext=true` is set, the returned metadata will also include the license text.\n\n\n ## Example request body:\n\n ```json\n [\n \"Apache-2.0\",\n \"BSD Zero Clause License\"\n ]\n ```\n\n\n ## Return value\n\n ```json\n // Response schema:\n Array<{\n " }, { "info": { "name": "Update License Policy", "type": "http" }, "http": { "method": "POST", "url": "https://api.socket.dev/v0/orgs/:org_slug/settings/license-policy", "params": [ { "name": "org_slug", "value": "", "type": "path", "description": "The slug of the organization" }, { "name": "merge_update", "value": "", "type": "query", "description": "Merge the policy update with the existing policy. Default is true. If false, the existing policy will be replaced with the new policy." } ], "body": { "type": "json", "data": "{}" }, "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Set the organization's license policy\n\n ## License policy schema\n\n```json\n{\n allow?: Array\n warn?: Array\n options?: Array\n}\n```\n\nElements of the `allow` and `warn` arrays strings representing items which should be allowed, or which should trigger a warning; license data found in package which not present in either array will produce a license violation (effectively a \"hard\" error). For example, to allow Apache-2.0 and MIT to the allow list, simply add the strings " }, { "info": { "name": "Get License Policy (Beta)", "type": "http" }, "http": { "method": "GET", "url": "https://api.socket.dev/v0/orgs/:org_slug/settings/license-policy/view", "params": [ { "name": "org_slug", "value": "", "type": "path", "description": "The slug of the organization" } ], "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Returns an organization's license policy including allow, warn, monitor, and deny categories.\nThe deny category contains all licenses that are not explicitly categorized as allow, warn, or monitor.\n\nThis endpoint consumes 1 unit of your quota.\n\nThis endpoint requires the following org token scopes:\n- license-policy:read" }, { "info": { "name": "License Policy (Beta)", "type": "http" }, "http": { "method": "POST", "url": "https://api.socket.dev/v0/license-policy", "body": { "type": "json", "data": "{}" }, "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "docs": "Compare the license data found for a list of packages (given as PURL strings) with the contents of a configurable license policy,\n returning information about license data which does not comply with the license allow list.\n\n ## Example request body:\n\n ```json\n {\n \"components\": [\n {\n \"purl\": \"pkg:npm/lodash@4.17.21\"\n },\n {\n \"purl\": \"pkg:npm/lodash@4.14.1\"\n }\n ],\n \"allow\": [\n \"permissive\",\n \"pkg:npm/lodash?file_" } ] } ], "bundled": true }