Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Generated Ruby Client Example #42

Merged
merged 7 commits into from
Dec 4, 2020
Merged

Adds Generated Ruby Client Example #42

merged 7 commits into from
Dec 4, 2020

Conversation

john-odonnell
Copy link
Contributor

@john-odonnell john-odonnell commented Nov 25, 2020

What does this PR do?

This PR adds an example which uses a spec-generated Ruby client.
The example is similar in workflow to the existing Python client example.
Updates certificates to include localhost as a leafnode SAN, allows SSL verification against
local Conjur instances.

What ticket does this PR close?

Closes #12

Checklists

Change log

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR, and/or there is a follow-on issue to update docs, or
  • This PR does not require updating any documentation

Copy link
Contributor

@sgnn7 sgnn7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@john-odonnell Great work on this! I left some comments but it seems pretty straightforward good addition!

config/https/README.md Outdated Show resolved Hide resolved
config/https/README.md Outdated Show resolved Hide resolved
examples/ruby/ruby_client.rb Show resolved Hide resolved
examples/ruby/ruby_client.rb Outdated Show resolved Hide resolved
examples/ruby/ruby_client.rb Show resolved Hide resolved
examples/ruby/ruby_client.rb Outdated Show resolved Hide resolved
examples/ruby/ruby_client.rb Outdated Show resolved Hide resolved
examples/ruby/ruby_client.rb Outdated Show resolved Hide resolved
examples/ruby/ruby_client.rb Outdated Show resolved Hide resolved
examples/ruby/run Outdated Show resolved Hide resolved
Copy link
Contributor

@sgnn7 sgnn7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@john-odonnell Code is looking great - just a few more comments!

examples/ruby/run Outdated Show resolved Hide resolved
examples/ruby/run Outdated Show resolved Hide resolved
examples/ruby/ruby_client.rb Outdated Show resolved Hide resolved
Copy link

@BradleyBoutcher BradleyBoutcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I think most of the remaining work should be focused on getting the example to run inside a container.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
examples/ruby/README.md Show resolved Hide resolved
examples/ruby/run Outdated Show resolved Hide resolved
examples/ruby/run Outdated Show resolved Hide resolved
telday
telday previously approved these changes Dec 2, 2020
Copy link
Contributor

@telday telday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@BradleyBoutcher BradleyBoutcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good improvements! Just a few more things to polish up, and it'll be ready to go.

.github/workflows/main.yml Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
examples/ruby/Dockerfile.ruby Outdated Show resolved Hide resolved
examples/ruby/Dockerfile.ruby Outdated Show resolved Hide resolved
examples/ruby/start Outdated Show resolved Hide resolved
examples/ruby/start Outdated Show resolved Hide resolved
@john-odonnell john-odonnell force-pushed the more-examples branch 2 times, most recently from 55f4965 to 4bd77d3 Compare December 3, 2020 19:05
@john-odonnell john-odonnell marked this pull request as ready for review December 3, 2020 19:17
@john-odonnell john-odonnell requested a review from a team as a code owner December 3, 2020 19:17
Adds localhost as a Subject Alternative Name on leafnode certificates.
Allows SSL verification on local Conjur instances.
Updates Python client demo to use HTTPS.
Previously, the policies were defined in the example. Moving their definition
to independent files will allow multiple examples to use the same policies
in their workflows.
Demonstrates the same API endpoints as the Python example:
- authentication
- password change
- policy load
- API key rotation of foreign role
- secret storage and retrieval
@john-odonnell john-odonnell changed the title Adds Generated Ruby Client Example WIP: Adds Generated Ruby Client Example Dec 4, 2020
@john-odonnell john-odonnell force-pushed the more-examples branch 2 times, most recently from 81d542b to 3ab960d Compare December 4, 2020 18:12
@john-odonnell john-odonnell changed the title WIP: Adds Generated Ruby Client Example Adds Generated Ruby Client Example Dec 4, 2020
Copy link

@BradleyBoutcher BradleyBoutcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there! Just two small things

examples/ruby/start Outdated Show resolved Hide resolved
examples/ruby/README.md Outdated Show resolved Hide resolved
Adds unique READMEs to each example, and generalizes terminology in
project main README regarding examples. Updates CHANGELOG.
Python exits on exceptions. Removing these blocks simplify the example,
and provide more extensive error messages if an exception does occur.
Done to eliminate the need for a user to install RVM before using the example.
This change includes the following:
- Adds a ruby-example service to the project's docker-compose
- Adds Dockerfile for building the ruby-example service
- Updates to the Ruby example program and start script to account for these changes
- Updates to start_conjur, integration_tests, and GHActions integration test workflow
  - These processes now build only the docker-compose services they require
  - GHAction workflow uses integration_tests script, reducing duplicate code
- Documentation regarding the examples are updated across the project
Script originally discarded output from other scripts, like generate_client and
start_conjur. Redirection was limited to stdout, allowing stderr to display.
Copy link

@BradleyBoutcher BradleyBoutcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✨

@john-odonnell john-odonnell merged commit fd38f69 into main Dec 4, 2020
@john-odonnell john-odonnell deleted the more-examples branch December 4, 2020 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

There is an example of how to use a spec-generated Ruby client
4 participants