{"id":19963673,"url":"https://github.com/cyberark/conjur-api-ruby","last_synced_at":"2025-06-14T08:38:08.641Z","repository":{"id":6167031,"uuid":"7396760","full_name":"cyberark/conjur-api-ruby","owner":"cyberark","description":"Ruby client for the CyberArk Conjur API","archived":false,"fork":false,"pushed_at":"2024-02-16T20:23:23.000Z","size":991,"stargazers_count":3,"open_issues_count":6,"forks_count":4,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-06-09T14:50:20.497Z","etag":null,"topics":["api-client","conjbot-notify","conjur","conjur-core","conjur-sdk","core","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/conjur-api","language":"Ruby","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/cyberark.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-01-01T16:17:28.000Z","updated_at":"2023-11-28T14:35:42.000Z","dependencies_parsed_at":"2024-06-19T16:53:47.448Z","dependency_job_id":"31a0ab46-3533-4157-b531-b8547bf652c4","html_url":"https://github.com/cyberark/conjur-api-ruby","commit_stats":{"total_commits":687,"total_committers":37,"mean_commits":18.56756756756757,"dds":0.6128093158660844,"last_synced_commit":"f302701a7f58a77d119a902bf82902b8820c8030"},"previous_names":[],"tags_count":93,"template":false,"template_full_name":null,"purl":"pkg:github/cyberark/conjur-api-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberark%2Fconjur-api-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberark%2Fconjur-api-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberark%2Fconjur-api-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberark%2Fconjur-api-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyberark","download_url":"https://codeload.github.com/cyberark/conjur-api-ruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberark%2Fconjur-api-ruby/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259789069,"owners_count":22911499,"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":["api-client","conjbot-notify","conjur","conjur-core","conjur-sdk","core","ruby","ruby-gem"],"created_at":"2024-11-13T02:16:45.301Z","updated_at":"2025-06-14T08:38:08.605Z","avatar_url":"https://github.com/cyberark.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Conjur::API\n\nProgrammatic Ruby access to the Conjur API.\n\nRDocs are available from the through the [Ruby Gem details page](https://rubygems.org/gems/conjur-api)\n\n## Using conjur-api-ruby with Conjur Open Source \n\nAre you using this project with [Conjur Open Source](https://github.com/cyberark/conjur)? Then we \n**strongly** recommend choosing the version of this project to use from the latest [Conjur OSS \nsuite release](https://docs.conjur.org/Latest/en/Content/Overview/Conjur-OSS-Suite-Overview.html). \nConjur maintainers perform additional testing on the suite release versions to ensure \ncompatibility. When possible, upgrade your Conjur version to match the \n[latest suite release](https://docs.conjur.org/Latest/en/Content/ReleaseNotes/ConjurOSS-suite-RN.htm); \nwhen using integrations, choose the latest suite release that matches your Conjur version. For any \nquestions, please contact us on [Discourse](https://discuss.cyberarkcommons.org/).\n\n# Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'conjur-api'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install conjur-api\n\n# Usage\n\nConnecting to Conjur is a two-step process:\n\n* **Configuration** Instruct the API where to find the Conjur endpoint and how to secure the connection.\n* **Authentication** Provide the API with credentials that it can use to authenticate.\n\n## Configuration\n\nThe simplest way to configure the Conjur API is to use the configuration file stored on the machine.\nIf you have configured the machine with [conjur init](http://developer.conjur.net/reference/tools/init.html),\nits default location is `~/.conjurrc`.\n\nThe Conjur configuration process also checks `/etc/conjur.conf` for global settings. This is typically used\nin server environments.\n\nFor custom scenarios, the location of the file can be overridden using the `CONJURRC` environment variable.\n\nYou can load the Conjur configuration file using the following Ruby code:\n\n```ruby\nrequire 'conjur/cli'\nConjur::Config.load\nConjur::Config.apply\n```\n\n**Note** this code requires the [conjur-cli](https://github.com/conjurinc/cli-ruby) gem, which should also be in your\ngemset or bundle.\n\n## Authentication\n\nOnce Conjur is configured, the connection can be established like this:\n\n```\nconjur = Conjur::Authn.connect nil, noask: true\n```\n\nTo [authenticate](http://developer.conjur.net/reference/services/authentication/authenticate.html), the API client must\nprovide a `login` name and `api_key`. The `Conjur::Authn.connect` will attempt the following, in order:\n\n1. Look for `login` in environment variable `CONJUR_AUTHN_LOGIN`, and `api_key` in `CONJUR_AUTHN_API_KEY`\n2. Look for credentials on disk. The default credentials file is `~/.netrc`. The location of the credentials file\ncan be overridden using the configuration file `netrc_path` option.\n3. Prompt for credentials. This can be disabled using the option `noask: true`.\n\n## Connecting Without Files\n\nIt's possible to configure and authenticate the Conjur connection without using any files, and without requiring\nthe `conjur-cli` gem.\n\nTo accomplish this, apply the configuration settings directly to the [Conjur::Configuration](https://github.com/conjurinc/api-ruby/blob/master/lib/conjur/configuration.rb)\nobject.\n\nFor example, specify the `account` and `appliance_url` (both of which are required) like this:\n\n```\nConjur.configuration.account = 'my-account'\nConjur.configuration.appliance_url = 'https://conjur.mydomain.com/api'\n```\n\nYou can also specify these values using environment variables, which is often a bit more convenient.\nEnvironment variables are mapped to configuration variables by prepending `CONJUR_` to the all-caps name of the\nconfiguration variable. For example, `appliance_url` is `CONJUR_APPLIANCE_URL`, `account` is `CONJUR_ACCOUNT`.\n\nIn either case, you will also need to configure certificate trust. For example:\n\n```\nOpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE.add_file \"/etc/conjur-yourorg.pem\"\n```\n\nOnce Conjur is configured, you can create a new API client by providing a `login` and `api_key`:\n\n```\nConjur::API.new_from_key login, api_key\n```\n\nNote that if you are connecting as a [Host](http://developer.conjur.net/reference/services/directory/host), the login should be\nprefixed with `host/`. For example: `host/myhost.example.com`, not just `myhost.example.com`.\n\n## Configuring RestClient\n\n[Conjur::Configuration](https://github.com/conjurinc/api-ruby/blob/master/lib/conjur/configuration.rb)\nallows optional configuration of the [RestClient](https://github.com/rest-client/rest-client)\ninstance used by Conjur API to communicate with the Conjur server, via the options hash\n`Conjur.configuration.rest_client_options`.\n\nThe default value for the options hash is:\n```ruby\n{\n  ssl_cert_store: OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE\n}\n```\n\nFor example, here's how you would configure the client to use a proxy and `ssl_ca_file` (instead of the default `ssl_cert_store`).\n```ruby\nConjur.configuration.rest_client_options = {\n    ssl_ca_file: \"ca_certificate.pem\",\n    proxy: \"http://proxy.example.com/\"\n}\n```\n\n## Contributing\n\nWe welcome contributions of all kinds to this repository. For instructions on how to get started and descriptions of our development workflows, please see our [contributing\nguide][contrib].\n\n[contrib]: https://github.com/cyberark/conjur-api-ruby/blob/main/CONTRIBUTING.md\n\n## License\n\nThis repository is licensed under Apache License 2.0 - see [`LICENSE`](LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberark%2Fconjur-api-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyberark%2Fconjur-api-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberark%2Fconjur-api-ruby/lists"}