{"id":31816651,"url":"https://github.com/splunk/splunk-cloud-sdk-go","last_synced_at":"2025-10-11T09:57:30.148Z","repository":{"id":41113857,"uuid":"127200958","full_name":"splunk/splunk-cloud-sdk-go","owner":"splunk","description":"The Splunk Cloud SDK for Go, contains libraries for building apps for the Splunk Cloud Services Platform.","archived":false,"fork":false,"pushed_at":"2024-03-13T21:51:54.000Z","size":2827,"stargazers_count":45,"open_issues_count":7,"forks_count":14,"subscribers_count":35,"default_branch":"master","last_synced_at":"2024-06-18T20:03:40.784Z","etag":null,"topics":["go","golang","sdk","splunk-cloud"],"latest_commit_sha":null,"homepage":"https://dev.splunk.com/scs/docs","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/splunk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-28T21:31:33.000Z","updated_at":"2024-03-21T23:21:48.000Z","dependencies_parsed_at":"2024-06-18T19:48:02.712Z","dependency_job_id":"268b5ddf-3526-4586-b045-b6d64bca3e84","html_url":"https://github.com/splunk/splunk-cloud-sdk-go","commit_stats":null,"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"purl":"pkg:github/splunk/splunk-cloud-sdk-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splunk%2Fsplunk-cloud-sdk-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splunk%2Fsplunk-cloud-sdk-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splunk%2Fsplunk-cloud-sdk-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splunk%2Fsplunk-cloud-sdk-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/splunk","download_url":"https://codeload.github.com/splunk/splunk-cloud-sdk-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splunk%2Fsplunk-cloud-sdk-go/sbom","scorecard":{"id":841882,"data":{"date":"2025-08-11","repo":{"name":"github.com/splunk/splunk-cloud-sdk-go","commit":"6c692c7f70b6de77a6274551bbfb1a0c755df3fb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: goCommand not pinned by hash: cicd/docs/docs_md.sh:6","Warn: goCommand not pinned by hash: cicd/publish/scloud/publish_github.sh:41","Info:   0 out of   2 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.12.0-beta.8 not signed: https://api.github.com/repos/splunk/splunk-cloud-sdk-go/releases/102430246","Warn: release artifact v1.12.0-beta.7 not signed: https://api.github.com/repos/splunk/splunk-cloud-sdk-go/releases/59285727","Warn: release artifact v1.12.0-beta.6 not signed: https://api.github.com/repos/splunk/splunk-cloud-sdk-go/releases/51309422","Warn: release artifact v1.12.0-beta.5 not signed: https://api.github.com/repos/splunk/splunk-cloud-sdk-go/releases/47453238","Warn: release artifact v1.12.0-beta.4 not signed: https://api.github.com/repos/splunk/splunk-cloud-sdk-go/releases/45330877","Warn: release artifact v1.12.0-beta.8 does not have provenance: https://api.github.com/repos/splunk/splunk-cloud-sdk-go/releases/102430246","Warn: release artifact v1.12.0-beta.7 does not have provenance: https://api.github.com/repos/splunk/splunk-cloud-sdk-go/releases/59285727","Warn: release artifact v1.12.0-beta.6 does not have provenance: https://api.github.com/repos/splunk/splunk-cloud-sdk-go/releases/51309422","Warn: release artifact v1.12.0-beta.5 does not have provenance: https://api.github.com/repos/splunk/splunk-cloud-sdk-go/releases/47453238","Warn: release artifact v1.12.0-beta.4 does not have provenance: https://api.github.com/repos/splunk/splunk-cloud-sdk-go/releases/45330877"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3372 / GHSA-6wxm-mpqj-6jpf","Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2024-2611 / GHSA-8r3f-844c-mc37"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T20:39:40.972Z","repository_id":41113857,"created_at":"2025-08-23T20:39:40.972Z","updated_at":"2025-08-23T20:39:40.972Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006745,"owners_count":26084185,"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-11T02:00:06.511Z","response_time":55,"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":["go","golang","sdk","splunk-cloud"],"created_at":"2025-10-11T09:57:29.000Z","updated_at":"2025-10-11T09:57:30.143Z","avatar_url":"https://github.com/splunk.png","language":"Go","readme":"# Splunk Cloud Services SDK for Go\n[![Go Report Card](https://goreportcard.com/badge/github.com/splunk/splunk-cloud-sdk-go)](https://goreportcard.com/report/github.com/splunk/splunk-cloud-sdk-go) \n[![GoDoc](https://godoc.org/github.com/splunk/splunk-cloud-sdk-go?status.svg)](https://godoc.org/github.com/splunk/splunk-cloud-sdk-go)\n\nThe Splunk Cloud Services software development kit (SDK) for Go contains library code and examples to enable you to build apps using the Splunk Cloud Services with the Go programming language.\n\n**Note:** This SDK is not used for Splunk Enterprise or Splunk Cloud development. For information about developing apps and add-ons for those products, see the [Splunk Developer Portal for Splunk Enterprise](https://dev.splunk.com/enterprise/).\n\n# Splunk Cloud Services CLI\n\nSplunk Cloud Services CLI, `scloud`, is a command-line tool for developers to make API calls to Splunk Cloud Services.\n\nFor more information about Splunk Cloud Services CLI, see the [Splunk Developer Portal](https://dev.splunk.com/scs/docs/overview/tools/tools_scloud).\n\n## Terms of Service\n\nLog in to [Splunk Investigate](https://si.scp.splunk.com/) and accept the Terms of Service when prompted.\n\n## Get started\n\n\n### Install Go and Go tools\n\n1. Install Go 1.11 or later from the [Getting Started](https://golang.org/doc/install) page on the Go Programmming Language website.\n\n2. Install recommended tools for Go by running the following commands:\n\n    ```bash\n    $ go get golang.org/x/lint/golint\n    $ go get -u golang.org/x/tools/cmd/goimports\n    ```\n\n\n### Initialize your project\n\nInitialize your project using Go modules for dependency support. Your project can be located outside of the **$GOPATH/src** directory. For more about modules, see [Go 1.11 Modules](https://github.com/golang/go/wiki/Modules) on the GitHub website.\n\n1. If your project is within your **$GOPATH**, set `GO111MODULE=on` in your environment variables.\n\n2. Initialize your project by running the following commands, but replace the `\u003cgithub.com/example/myproject\u003e` path with your Git host, organization, user name, and project name as appropriate:\n\n    ```bash\n    $ mkdir myproject \u0026\u0026 cd myproject\n    $ go mod init \u003cgithub.com/example/myproject\u003e\n    ```\n\n3. Create a **main.go** file within your project directory containing the following code:\n\n    ```go\n    package main\n\n    import (\n        \"fmt\"\n        \"os\"\n\n        \"github.com/splunk/splunk-cloud-sdk-go/sdk\"\n        \"github.com/splunk/splunk-cloud-sdk-go/services\"\n        \"github.com/splunk/splunk-cloud-sdk-go/services/identity\"\n    )\n\n    func main() {\n        checkForTenantToken()\n        // Initialize the client\n        client, err := sdk.NewClient(\u0026services.Config{\n            Token:  os.Getenv(\"BEARER_TOKEN\"),\n            Tenant: os.Getenv(\"TENANT\"),\n        })\n        exitOnErr(err)\n        // Validate access to Splunk Cloud Services and tenant\n        query := identity.ValidateTokenQueryParams{Include: identity.ValidateTokeninclude{\"principal\", \"tenant\"}}\n        info, err := client.IdentityService.ValidateToken(\u0026query)\n        exitOnErr(err)\n        fmt.Println(\"name: \" + info.Name)\n        fmt.Println(\"principal name: \" + info.Principal.Name)\n        fmt.Println(\"tenant name: \" + info.Tenant.Name)\n    }\n\n    func exitOnErr(err error) {\n        if err != nil {\n            fmt.Println(err)\n            os.Exit(1)\n        }\n    }\n\n    func checkForTenantToken() {\n        if os.Getenv(\"BEARER_TOKEN\") == \"\" {\n            exitOnErr(fmt.Errorf(\"$BEARER_TOKEN must be set\"))\n        }\n        if os.Getenv(\"TENANT\") == \"\" {\n            exitOnErr(fmt.Errorf(\"$TENANT must be set\"))\n        }\n    }\n    ```\n\n4. Set your access token and tenant.\n\n    -  Retrieve your access token from the [Splunk Cloud Console](https://console.scp.splunk.com).\n       -  Log in with your email address. \n       -  Enter/Choose your tenant.\n       -  Navigate to the Settings page from the top-right dropdown.\n       -  Under **Authorization** / Access Token click **Copy to clipboard** to copy your token.\n    -  Run the following command, replacing `\u003caccessToken\u003e` and `\u003ctenant\u003e` with your values:\n\n        ```bash\n        $ export BEARER_TOKEN=\u003caccessToken\u003e\n        $ export TENANT=\u003ctenant\u003e\n        ```\n\n5. Build and run your project by running the following commands, where `\u003cproject\u003e` is the name of your project, and `\u003cme@example.com\u003e` is your user name:\n\n    ```bash\n    $ go build\n    $ ./\u003cproject\u003e\n    name: \u003cme@example.com\u003e\n    principal name: \u003cme@example.com\u003e\n    tenant name: \u003cmytenant\u003e\n    ```\n\n## scloud login using device flow with access to environments: `playground`, `staging`, `prod`, `playground-scs`, `staging-scs` (gstage) and `prod-scs` (gprod1)\nTo gain access to the environments through scloud cli, set the following config variables:\n- `username` associated with the environment you are intending to use, example: \n   ```bash\n   $ scloud config set --key username --value \u003cyour_username\u003e\n   ```\n   \n- `tenant` associated with the environment you are intending to use, example: \n   ```bash\n   $ scloud config set --key tenant --value \u003cyour_tenant\u003e\n   ``` \n\n- `env` (envrionment), example:\n   ```bash\n   $ scloud config set --key env --value \u003cany of the five available environments: `playground`, `staging`, `prod`, `playground-scs`, `staging-scs` (gstage) or `prod-scs` (gprod1)\u003e\n   ```\n\nOnce the environment variables are set, you can login using the command below:\n```bash\n$ scloud login --use-device\n```\n\nIf the environment variables - tenant, username and env are set correctly, you will see the message given below prompting\nyou to follow the verification browser link and to use the given code in that browser page to complete the login process.\n```bash\n$ scloud login --use-device\nPlease validate user code in browser!\nVerification URL: https://auth.staging.scs.splunk.com/verify?tenant=\u003cyour_set_tenant\u003e \nUser Code: \u003crandom_code\u003e\n```\n\nAn example command to access core services using scloud cli once the `scloud login --use-device` above has succeeded:\n```bash\n$ scloud appreg list-subscriptions\n```\n\nIf the environment variables are not set correctly, you may see the following error:\n```bash \n$ scloud login --use-device\nfailed to get successful response from device endpoint: 401\n Try again using the --logtostderr flag to show details about the error.\n```\n\n## Documentation\nFor general documentation, see the [Splunk Developer Portal](https://dev.splunk.com/scs/).\n\nFor reference documentation, see the [Splunk Cloud Services SDK for Go API Reference](https://dev.splunk.com/scs/reference/sdk/splunk-cloud-sdk-go).\n\n## Contributing\n\nDo not directly edit any source file with `_generated` in the name because that file was generated from service specifications.\n\n## Contact\nIf you have questions, reach out to us on [Slack](https://splunkdevplatform.slack.com) in the **#sdc** channel or email us at _devinfo@splunk.com_.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplunk%2Fsplunk-cloud-sdk-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsplunk%2Fsplunk-cloud-sdk-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplunk%2Fsplunk-cloud-sdk-go/lists"}