{"id":23564171,"url":"https://github.com/selectel/iam-go","last_synced_at":"2025-04-30T16:18:01.368Z","repository":{"id":221679157,"uuid":"747696889","full_name":"selectel/iam-go","owner":"selectel","description":"Go SDK for Selectel IAM API","archived":false,"fork":false,"pushed_at":"2024-07-31T14:53:37.000Z","size":62,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-30T16:17:37.937Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/selectel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":null,"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}},"created_at":"2024-01-24T13:13:36.000Z","updated_at":"2024-07-31T14:41:22.000Z","dependencies_parsed_at":"2024-03-27T15:28:20.466Z","dependency_job_id":"9e684a58-70a3-44b5-b55b-c129f58abe43","html_url":"https://github.com/selectel/iam-go","commit_stats":null,"previous_names":["selectel/iam-go"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Fiam-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Fiam-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Fiam-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Fiam-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selectel","download_url":"https://codeload.github.com/selectel/iam-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251739677,"owners_count":21635893,"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","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":[],"created_at":"2024-12-26T17:13:13.203Z","updated_at":"2025-04-30T16:18:01.297Z","avatar_url":"https://github.com/selectel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iam-go: Go SDK for IAM API\n\n[![Go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/selectel/iam-go/)\n[![Go Report Card](https://goreportcard.com/badge/github.com/selectel/iam-go)](https://goreportcard.com/report/github.com/selectel/iam-go)\n[![codecov](https://codecov.io/gh/Selectel/iam-go/branch/main/graph/badge.svg)](https://codecov.io/gh/Selectel/iam-go)\n\nPackage iam-go provides Go SDK to work with the Selectel IAM API.\n\nJump To:\n* [Documentation](#Documentation)\n* [Getting started](#Getting-started)\n* [Additional info](#Additional-info)\n\n## Documentation\n\nThe Go library documentation is available at [go.dev](https://pkg.go.dev/github.com/selectel/iam-go/).\n\n## Getting started\n\nYou can use this library to work with the following objects of the Selectel IAM API:\n\n* [users](https://pkg.go.dev/github.com/selectel/iam-go/service/users)\n* [serviceusers](https://pkg.go.dev/github.com/selectel/iam-go/service/serviceusers)\n* [groups](https://pkg.go.dev/github.com/selectel/iam-go/service/groups)\n* [s3credentials](https://pkg.go.dev/github.com/selectel/iam-go/service/s3credentials)\n* [federations (saml)](https://pkg.go.dev/github.com/selectel/iam-go/service/federations/saml)\n\n### Installation\n\nYou can install `iam-go` via `go get` command:\n\n```bash\ngo get github.com/selectel/iam-go\n```\n\n### Authentication\n\nTo work with the Selectel IAM API you first need to:\n\n* Create a Selectel account: [registration page](https://my.selectel.ru/registration).\n* Retrieve a Keystone Token for your account via [API](https://developers.selectel.com/docs/control-panel/authorization/#obtain-keystone-token) or [go-selvpcclient](https://github.com/selectel/go-selvpcclient).\n\nAfter that initialize `Client` with the retrieved token.\n\n\n### Usage example\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"log\"\n\n    \"github.com/selectel/iam-go\"\n)\n\nfunc main() {\n    // A KeystoneToken to work with the Selectel IAM API.\n    // It should be Service User Token\n    token := \"gAAAAABeVNzu-...\"\n\n    // A Prefix to be added to User-Agent.\n    prefix := \"iam-custom\"\n\n    // Create a new IAM client.\n    iamClient, err := iam.New(\n    \tiam.WithAuthOpts(\u0026iam.AuthOpts{KeystoneToken: token}),\n    \tiam.WithUserAgentPrefix(prefix),\n    )\n    // Handle the error.\n    if err != nil {\n        log.Fatalf(\"Error occured: %s\", err)\n        return\n    }\n\n    // Get the Users instance.\n    usersAPI := iamClient.Users\n\n    // Prepare an empty context.\n    ctx := context.Background()\n\n    // Get all users.\n    users := usersAPI.List(ctx)\n\n    // Print info about each user.\n    for _, user := range users {\n        fmt.Println(\"ID:\", user.ID)\n        fmt.Println(\"KeystoneID:\", user.Keystone.ID)\n        fmt.Println(\"AuthType:\", user.AuthType)\n    }\n}\n```\n\n## Additional info\n* See [examples](./examples) for more code examples of iam-go\n* Read [docs](./docs) for advanced topics and guides\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselectel%2Fiam-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselectel%2Fiam-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselectel%2Fiam-go/lists"}