{"id":32565837,"url":"https://github.com/stackql/stackql-provider-okta","last_synced_at":"2025-10-29T04:53:48.024Z","repository":{"id":312942916,"uuid":"1048879132","full_name":"stackql/stackql-provider-okta","owner":"stackql","description":"generate stackql provider for Okta from openapi specs","archived":false,"fork":false,"pushed_at":"2025-09-12T00:03:11.000Z","size":2380,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-12T02:53:28.001Z","etag":null,"topics":["okta","stackql","stackql-provider"],"latest_commit_sha":null,"homepage":"https://okta-provider.stackql.io/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-02T06:56:01.000Z","updated_at":"2025-09-12T00:03:16.000Z","dependencies_parsed_at":"2025-09-03T01:20:34.447Z","dependency_job_id":null,"html_url":"https://github.com/stackql/stackql-provider-okta","commit_stats":null,"previous_names":["stackql/stackql-provider-okta"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stackql/stackql-provider-okta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-provider-okta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-provider-okta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-provider-okta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-provider-okta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackql","download_url":"https://codeload.github.com/stackql/stackql-provider-okta/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-provider-okta/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281563798,"owners_count":26522704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["okta","stackql","stackql-provider"],"created_at":"2025-10-29T04:53:40.532Z","updated_at":"2025-10-29T04:53:48.016Z","avatar_url":"https://github.com/stackql.png","language":"JavaScript","readme":"## `okta` provider for [`stackql`](https://github.com/stackql/stackql)\r\n\r\nThis repository is used to generate and document the Okta provider for StackQL, allowing you to query and manipulate Okta resources using SQL-like syntax. The provider is built using the `@stackql/provider-utils` package, which provides tools for converting OpenAPI specifications into StackQL-compatible provider schemas.\r\n\r\nThe `@stackql/provider-utils` package offers several utilities that this provider uses:\r\n- `split` - Divides a large OpenAPI spec into smaller service-specific files\r\n- `analyze` - Examines OpenAPI specs and generates mapping configuration files\r\n- `generate` - Creates StackQL provider extensions from OpenAPI specs and mappings\r\n- `docgen` - Builds documentation for the provider\r\n\r\n### Prerequisites\r\n\r\nTo use the Okta provider with StackQL, you'll need:\r\n\r\n1. An Okta account with appropriate API credentials\r\n2. An Okta API token with sufficient permissions for the resources you want to access, export this as `OKTA_API_TOKEN`\r\n3. StackQL CLI installed on your system (see [StackQL](https://github.com/stackql/stackql))\r\n\r\n### 1. Download the Open API Specification\r\n\r\nFirst, download the Okta Management API OpenAPI specification:\r\n\r\n```bash\r\ncurl -L https://raw.githubusercontent.com/okta/okta-management-openapi-spec/master/dist/current/management-minimal.yaml \\\r\n  -o provider-dev/downloaded/management-minimal.yaml\r\n```\r\n\r\nThis downloads the official Okta Management API specification, which defines all available API endpoints, request parameters, and response schemas.\r\n\r\n### 2. Split into Service Specs\r\n\r\nNext, split the monolithic OpenAPI specification into service-specific files:\r\n\r\n```bash\r\nnpm run split -- \\\r\n  --provider-name okta \\\r\n  --api-doc provider-dev/downloaded/management-minimal.yaml \\\r\n  --svc-discriminator path \\\r\n  --output-dir provider-dev/source \\\r\n  --overwrite\r\n```\r\n\r\nThis step breaks down the large Okta API specification into smaller, more manageable service files. The `--svc-discriminator path` option tells the tool to use the URL path structure to determine which API endpoints belong to which service. For Okta, this creates separate files for different functional areas like users, groups, applications, etc.\r\n\r\n### 3. Generate Mappings\r\n\r\nGenerate the mapping configuration that connects OpenAPI operations to StackQL resources:\r\n\r\n```bash\r\nnpm run generate-mappings -- \\\r\n  --provider-name okta \\\r\n  --input-dir provider-dev/source \\\r\n  --output-dir provider-dev/config\r\n```\r\n\r\nThis step analyzes the service specs and creates a CSV mapping file that defines how OpenAPI operations translate to StackQL resources, methods, and SQL verbs. The mapping process handles two scenarios:\r\n\r\n1. **New Provider Development**: If no mapping file exists yet, this creates a new `all_services.csv` file with all operations from the OpenAPI spec. You'll need to edit this file to assign appropriate resource names, method names, and SQL verbs.\r\n\r\n2. **Updating Existing Mappings**: If a mapping file already exists, the tool will:\r\n   - Load the existing mappings\r\n   - Identify new operations that aren't yet mapped\r\n   - Flag operations with incomplete mappings (missing resource, method, or SQL verb)\r\n   - Skip operations that are already fully mapped\r\n\r\nUpdate the resultant `provider-dev/config/all_services.csv` to add the `stackql_resource_name`, `stackql_method_name`, `stackql_verb` values for each operation.\r\n\r\n### 4. Generate Provider\r\n\r\nThis step transforms the split OpenAPI service specs into a fully-functional StackQL provider by applying the resource and method mappings defined in your CSV file.\r\n\r\n```bash\r\nnpm run generate-provider -- \\\r\n  --provider-name okta \\\r\n  --input-dir provider-dev/source \\\r\n  --output-dir provider-dev/openapi/src/okta \\\r\n  --config-path provider-dev/config/all_services.csv \\\r\n  --servers '[{\"url\": \"https://{subdomain}.okta.com/\", \"variables\": {\"subdomain\": {\"default\": \"my-org\",\"description\": \"The domain of your organization. This can be a provided subdomain of an official okta domain (okta.com, oktapreview.com, etc) or one of your configured custom domains.\"}}}]' \\\r\n  --provider-config '{\"auth\": {\"credentialsenvvar\": \"OKTA_API_TOKEN\",\"type\": \"api_key\",\"valuePrefix\": \"SSWS \"}}' \\\r\n  --skip-files _well_known.yaml \\\r\n  --overwrite\r\n```\r\nMake necessary updates to the output docs:\r\n\r\n```bash\r\nsh provider-dev/scripts/post_processing.sh\r\n```\r\n\r\nThe `--servers` parameter defines the base URL pattern for API requests, with variables that users can customize. For Okta, this allows specifying different subdomains for different Okta instances.\r\n\r\nThe `--provider-config` parameter sets up the authentication method. For Okta, this configures an API token authentication scheme that:\r\n- Looks for the API token in the `OKTA_API_TOKEN` environment variable\r\n- Applies the `SSWS ` prefix required by Okta's API\r\n- Uses the token as an API key in the Authorization header\r\n\r\nThe generated provider will be structured according to the StackQL conventions, with properly organized resources and methods that map to the underlying API operations.\r\n\r\nAfter running this command, you'll have a complete provider structure in the `provider-dev/openapi/src` directory, ready for testing or packaging.\r\n\r\n### 5. Test Provider\r\n\r\n#### Starting the StackQL Server\r\n\r\nBefore running tests, start a StackQL server with your provider:\r\n\r\n```bash\r\nPROVIDER_REGISTRY_ROOT_DIR=\"$(pwd)/provider-dev/openapi\"\r\nnpm run start-server -- --provider okta --registry $PROVIDER_REGISTRY_ROOT_DIR\r\n```\r\n\r\n#### Test Meta Routes\r\n\r\nTest all metadata routes (services, resources, methods) in the provider:\r\n\r\n```bash\r\nnpm run test-meta-routes -- okta --verbose\r\n```\r\nWhen you're done testing, stop the StackQL server:\r\n\r\n```bash\r\nnpm run stop-server\r\n```\r\n\r\nuse this command to view the server status:\r\n\r\n```bash\r\nnpm run server-status\r\n```\r\n\r\n#### Run test queries\r\n\r\nRun some test queries against the provider using the `stackql shell`:\r\n\r\n```bash\r\nPROVIDER_REGISTRY_ROOT_DIR=\"$(pwd)/provider-dev/openapi\"\r\nREG_STR='{\"url\": \"file://'${PROVIDER_REGISTRY_ROOT_DIR}'\", \"localDocRoot\": \"'${PROVIDER_REGISTRY_ROOT_DIR}'\", \"verifyConfig\": {\"nopVerify\": true}}'\r\n./stackql shell --registry=\"${REG_STR}\"\r\n```\r\n\r\n### 6. Publish the provider\r\n\r\nTo publish the provider push the `okta` dir to `providers/src` in a feature branch of the [`stackql-provider-registry`](https://github.com/stackql/stackql-provider-registry).  Follow the [registry release flow](https://github.com/stackql/stackql-provider-registry/blob/dev/docs/build-and-deployment.md).  \r\n\r\nLaunch the StackQL shell:\r\n\r\n```bash\r\nexport DEV_REG=\"{ \\\"url\\\": \\\"https://registry-dev.stackql.app/providers\\\", \\\"verifyConfig\\\": { \\\"nopVerify\\\": true }}\"\r\n./stackql --registry=\"${DEV_REG}\" shell\r\n```\r\n\r\npull the latest dev `okta` provider:\r\n\r\n```sql\r\nregistry pull okta;\r\n```\r\n\r\nRun some test queries, for example...\r\n\r\n```sql\r\nSELECT\r\nid,\r\nactivated,\r\ncreated,\r\nlastLogin,\r\nlastUpdated,\r\npasswordChanged,\r\nJSON_EXTRACT(profile, '$.email') as email,\r\nJSON_EXTRACT(profile, '$.firstName') as first_name,\r\nJSON_EXTRACT(profile, '$.lastName') as last_name,\r\nstatus,\r\nstatusChanged\r\nFROM okta.users.users\r\nWHERE subdomain = 'your-subdomain';\r\n```\r\n\r\n### 7. Generate web docs\r\n\r\n```bash\r\nnpm run generate-docs -- \\\r\n  --provider-name okta \\\r\n  --provider-dir ./provider-dev/openapi/src/okta/v00.00.00000 \\\r\n  --output-dir ./website \\\r\n  --provider-data-dir ./provider-dev/docgen/provider-data\r\n```  \r\n\r\n### 8. Test web docs locally\r\n\r\n```bash\r\ncd website\r\n# test build\r\nyarn build\r\n\r\n# run local dev server\r\nyarn start\r\n```\r\n\r\n### 9. Publish web docs to GitHub Pages\r\n\r\nUnder __Pages__ in the repository, in the __Build and deployment__ section select __GitHub Actions__ as the __Source__.  In Netlify DNS create the following records:  \r\n\r\n| Source Domain | Record Type  | Target |\r\n|---------------|--------------|--------|\r\n| okta-provider.stackql.io | CNAME | stackql.github.io |\r\n\r\n## License\r\n\r\nMIT\r\n\r\n## Contributing\r\n\r\nContributions to the Okta provider are welcome! Please feel free to submit a Pull Request.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackql%2Fstackql-provider-okta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackql%2Fstackql-provider-okta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackql%2Fstackql-provider-okta/lists"}