Skip to content

Commit f841074

Browse files
szhGitHub Enterprise
authored andcommitted
Merge pull request #4 from Conjur-Enterprise/remove-v4
CNJR-2935: Remove support for Conjur v4
2 parents 1eafa45 + 4a7c72a commit f841074

40 files changed

Lines changed: 367 additions & 1163 deletions

.rubocop_todo.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,7 @@ Lint/UnneededSplatExpansion:
309309
Lint/UnusedMethodArgument:
310310
Exclude:
311311
- 'lib/conjur/api.rb'
312-
- 'lib/conjur/api/router/v4.rb'
313-
- 'lib/conjur/api/router/v5.rb'
312+
- 'lib/conjur/api/router.rb'
314313
- 'lib/conjur/base_object.rb'
315314
- 'lib/conjur/cache.rb'
316315
- 'lib/conjur/has_attributes.rb'
@@ -538,7 +537,7 @@ Style/MethodDefParentheses:
538537
- 'lib/conjur/acts_as_rolsource.rb'
539538
- 'lib/conjur/acts_as_user.rb'
540539
- 'lib/conjur/api.rb'
541-
- 'lib/conjur/api/router/v5.rb'
540+
- 'lib/conjur/api/router.rb'
542541
- 'lib/conjur/configuration.rb'
543542
- 'lib/conjur/escape.rb'
544543
- 'lib/conjur/has_attributes.rb'
@@ -552,8 +551,7 @@ Style/MethodDefParentheses:
552551
# SupportedStyles: module_function, extend_self
553552
Style/ModuleFunction:
554553
Exclude:
555-
- 'lib/conjur/api/router/v4.rb'
556-
- 'lib/conjur/api/router/v5.rb'
554+
- 'lib/conjur/api/router.rb'
557555

558556
# Offense count: 1
559557
Style/MultilineBlockChain:

CHANGELOG.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99
- Nothing should go in this section, please add to the latest unreleased version
1010
(and update the corresponding date), or add a new version.
1111

12-
## [5.4.2] - 2023-09-11
12+
## [6.0.0] - 2023-12-28
13+
14+
### Removed
15+
- Remove support for Conjur V4 (CNJR-2935)
1316

1417
## [5.4.1] - 2023-06-14
1518

@@ -386,8 +389,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
386389

387390
## [2.0.0] - 2013-13-12
388391

389-
[Unreleased]: https://github.com/cyberark/conjur-api-ruby/compare/v5.4.1...HEAD
390-
[5.4.2]: https://github.com/cyberark/conjur-api-ruby/compare/v5.4.1...v5.4.2
392+
[Unreleased]: https://github.com/cyberark/conjur-api-ruby/compare/v6.0.0...HEAD
393+
[6.0.0]: https://github.com/cyberark/conjur-api-ruby/compare/v5.4.1...v6.0.0
391394
[5.4.1]: https://github.com/cyberark/conjur-api-ruby/compare/v5.4.0...v5.4.1
392395
[5.4.0]: https://github.com/cyberark/conjur-api-ruby/compare/v5.3.7...v5.4.0
393396
[5.3.7]: https://github.com/cyberark/conjur-api-ruby/compare/v5.3.6...v5.3.7

CONTRIBUTING.md

Lines changed: 27 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -7,132 +7,88 @@ For general contribution and community guidelines, please see the [community rep
77
1. [Fork the project](https://help.github.com/en/github/getting-started-with-github/fork-a-repo)
88
2. [Clone your fork](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository)
99
3. Make local changes to your fork by editing files
10-
3. [Commit your changes](https://help.github.com/en/github/managing-files-in-a-repository/adding-a-file-to-a-repository-using-the-command-line)
11-
4. [Push your local changes to the remote server](https://help.github.com/en/github/using-git/pushing-commits-to-a-remote-repository)
12-
5. [Create new Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork)
10+
4. [Commit your changes](https://help.github.com/en/github/managing-files-in-a-repository/adding-a-file-to-a-repository-using-the-command-line)
11+
5. [Push your local changes to the remote server](https://help.github.com/en/github/using-git/pushing-commits-to-a-remote-repository)
12+
6. [Create new Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork)
1313

1414
From here your pull request will be reviewed and once you've responded to all
1515
feedback it will be merged into the project. Congratulations, you're a
1616
contributor!
1717

18+
## Development
1819

19-
## Development (V5)
20-
To develop and run tests against Conjur V5, use the `start` and `stop` scripts in the `dev` folder. The start script brings up an open source Conjur (and Postgres database), CLI container, and a "work" container, with the gem code mounted into the working directory.
20+
To develop and run tests against Conjur, use the `start` and `stop` scripts in the `dev` folder. The start script brings up an open source Conjur (and Postgres database), CLI container, and a "work" container, with the gem code mounted into the working directory.
2121

2222
### Starting a Shell
23+
2324
To begin:
25+
2426
```sh
2527
$ cd dev
2628
$ ./start
2729
...
2830
root@9df0ac10ada2:/src/conjur-api#
2931
```
32+
3033
You'll be dropped into development container upon completion. From there, install the development gems:
3134

3235
```sh
3336
root@9df0ac10ada2:/src/conjur-api# bundle
3437
```
3538

3639
#### Running Tests
37-
*NOTE*: There are some existing challenges around running tests from the development console. For now, run tests
38-
by using the `./test.sh` script utilized for Jenkins Pipelines.
39-
40-
<!--
41-
Commented out until I can get tests running locally
4240

4341
Tests can be run with:
42+
4443
```sh
4544
root@9df0ac10ada2:/src/conjur-api# bundle exec cucumber features
4645
root@9df0ac10ada2:/src/conjur-api# bundle exec rspec
4746
```
48-
-->
47+
48+
Note: At the moment some of the cucumber tests are failing when run in the development container.
49+
You can use the CI script, `test.sh` to run the full test suite instead.
4950

5051
#### Stopping & Environment Cleanup
52+
5153
Once you're done, exit the shell, and stop the containers:
5254

5355
```sh
5456
root@9df0ac10ada2:/src/conjur-api# exit
5557
$ ./stop
5658
```
5759

58-
## Development (V4)
59-
60-
The file `docker-compose.yml` is a self-contained development environment for the project.
61-
62-
### Starting
63-
64-
To bring it up, run:
65-
66-
```sh-session
67-
$ docker compose build
68-
$ docker compose up -d pg conjur_4 conjur_5
69-
```
70-
71-
Then configure the v4 and v5 servers:
72-
73-
```sh-session
74-
$ ./ci/configure_v4.sh
75-
...
76-
$ ./ci/configure_v5.sh
77-
...
78-
```
79-
80-
### Using
81-
82-
Obtain the API key for the v5 admin user:
83-
84-
```
85-
$ docker compose exec conjur_5 rake 'role:retrieve-key[cucumber:user:admin]'
86-
3aezp05q3wkem3hmegymwzz8wh3bs3dr6xx3y3m2q41k5ymebkc
87-
```
88-
89-
The password of the v4 admin user is "secret".
90-
91-
Now you can run the client `dev` container:
92-
93-
```sh-session
94-
$ docker compose run --rm dev
95-
```
96-
97-
This gives you a shell session with `conjur_4` and `conjur_5` available as linked containers.
98-
9960
### Demos
10061

101-
For a v5 demo, run:
102-
10362
```sh-session
104-
$ bundle exec ./example/demo_v5.rb <admin-api-key>
105-
```
106-
107-
For a v4 demo, run:
108-
109-
```sh-session
110-
$ bundle exec ./example/demo_v4.rb
63+
bundle exec ./example/demo.rb <admin-api-key>
11164
```
11265

11366
### Stopping
11467

11568
To bring it down, run:
11669

11770
```sh-session
118-
$ docker compose down
71+
docker compose down
11972
```
12073

12174
## Releasing
12275

12376
### Update the version and changelog
12477

12578
1. Create a new branch for the version bump.
79+
1. Based on the changelog content, determine the new version number and update.
80+
1. Review the [changelog](CHANGELOG.md) to make sure all relevant changes since
81+
the last release have been captured. You may find it helpful to look at the
82+
list of commits since the last release.
83+
84+
This is also a good time to make sure all entries conform to our
85+
[changelog guidelines](https://github.com/cyberark/community/blob/main/Conjur/CONTRIBUTING.md#changelog-guidelines).
12686
1. Commit these changes - `Bump version to x.y.z` is an acceptable commit message - and open a PR
12787
for review. Your PR should include updates to `CHANGELOG.md`.
12888

129-
### Add a git tag
130-
131-
1. Once your changes have been **reviewed and merged into main**, tag the version
132-
using `git tag -a "vx.y.z" -m "vx.y.z release"`. Note this requires you to be able to sign releases.
133-
Consult the [github documentation on signing commits](https://help.github.com/articles/signing-commits-with-gpg/)
134-
on how to set this up. `vx.y.z release` is an acceptable tag message.
135-
1. Push the tag: `git push vx.y.z` (or `git push origin vx.y.z` if you are working
136-
from your local machine).
89+
### Release and Promote
13790

138-
After pushing the tag, a matching version will be published to [RubyGems](https://rubygems.org/gems/conjur-api/versions)!
91+
1. Jenkins build parameters can be utilized to release and promote successful builds.
92+
1. Merging into main/master branches will automatically trigger a release.
93+
1. Reference the [internal automated release doc](https://github.com/conjurinc/docs/blob/master/reference/infrastructure/automated_releases.md#release-and-promotion-process)
94+
for releasing and promoting.

README.md

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,6 @@ Programmatic Ruby access to the Conjur API.
44

55
RDocs are available from the through the [Ruby Gem details page](https://rubygems.org/gems/conjur-api)
66

7-
# Server Versions
8-
9-
The Conjur server comes in two major versions:
10-
11-
* **4.x** Conjur 4 is a commercial, non-open-source product, which is documented at [https://developer.conjur.net/](https://developer.conjur.net/).
12-
* **5.x** Conjur 5 is open-source software, hosted and documented at [https://www.conjur.org/](https://www.conjur.org/).
13-
14-
You can use the `main` branch of this project, which is `conjur-api` version `5.x`, to do all of the following things against either type of Conjur server:
15-
16-
* Authenticate
17-
* Fetch secrets
18-
* Check permissions
19-
* List roles, resources, members, memberships and permitted roles.
20-
* Create hosts using host factory
21-
* Rotate API keys
22-
23-
Use the configuration setting `Conjur.configuration.version` to select your server version, or set the environment variable `CONJUR_VERSION`. In either case, the valid values are `4` and `5`; the default is `5`.
24-
25-
If you are using Conjur server version `4.x`, you can also choose to use the `conjur-api` version `4.x`. In this case, the `Configuration.version` setting is not required (actually, it doesn't exist).
26-
277
## Using conjur-api-ruby with Conjur Open Source
288

299
Are you using this project with [Conjur Open Source](https://github.com/cyberark/conjur)? Then we
@@ -33,7 +13,7 @@ Conjur maintainers perform additional testing on the suite release versions to e
3313
compatibility. When possible, upgrade your Conjur version to match the
3414
[latest suite release](https://docs.conjur.org/Latest/en/Content/ReleaseNotes/ConjurOSS-suite-RN.htm);
3515
when using integrations, choose the latest suite release that matches your Conjur version. For any
36-
questions, please contact us on [Discourse](https://discuss.cyberarkcommons.org/c/conjur/5).
16+
questions, please contact us on [Discourse](https://discuss.cyberarkcommons.org/).
3717

3818
# Installation
3919

Rakefile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ begin
2323
require 'cucumber'
2424
require 'cucumber/rake/task'
2525

26-
Cucumber::Rake::Task.new(:cucumber_4) do |t|
27-
t.cucumber_opts = "--tags ~@wip --format pretty --format junit --out features_v4/reports -r features_v4/step_definitions/ -r features_v4/support/ features_v4/"
28-
end
29-
30-
Cucumber::Rake::Task.new(:cucumber_5) do |t|
26+
Cucumber::Rake::Task.new(:cucumber) do |t|
3127
t.cucumber_opts = "--tags ~@wip --format pretty --format junit --out features/reports"
3228
end
3329

@@ -36,8 +32,7 @@ begin
3632
desc "Run the spec and cucumber suites, compute the test results and coverage statistics, build Yard docs"
3733
task :jenkins_init => [ :init_coverage, :cuke_report_cleanup ]
3834
task :jenkins_spec => [ :"ci:setup:rspec", :spec ]
39-
task :jenkins_cucumber_v4 => [ :cucumber_4 ]
40-
task :jenkins_cucumber_v5 => [ :cucumber_5 ]
35+
task :jenkins_cucumber => [ :cucumber ]
4136
rescue LoadError
4237
warn "ci_reporter_rspec not found, jenkins task will be unavailable"
4338
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
source ./ci/oauth/keycloak/keycloak_functions.sh
44

5-
cat << "CONFIGURE" | docker exec -i $(docker compose ps -q conjur_5) bash
5+
cat << "CONFIGURE" | docker exec -i $(docker compose ps -q conjur) bash
66
set -e
77
88
for _ in $(seq 20); do

ci/configure_v4.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

ci/oauth/keycloak/keycloak_functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ function fetch_keycloak_certificate() {
6767
# Fetch SSL cert to communicate with keycloak (OIDC provider).
6868
echo "Initialize keycloak certificate in conjur server"
6969
docker compose exec -T \
70-
conjur_5 /scripts/fetch_certificate
70+
conjur /scripts/fetch_certificate
7171
}

dev/docker-compose.yml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,47 @@
11
version: '3'
22
services:
33
pg:
4-
image: postgres:9.3
4+
image: postgres:15
5+
environment:
6+
POSTGRES_HOST_AUTH_METHOD: trust
57

6-
conjur_5:
8+
conjur:
79
image: cyberark/conjur
810
command: server -a cucumber
911
environment:
1012
DATABASE_URL: postgres://postgres@pg/postgres
1113
CONJUR_DATA_KEY: 'WMfApcDBtocRWV+ZSUP3Tjr5XNU+Z2FdBb6BEezejIs='
1214
volumes:
13-
- authn_local_5:/run/authn-local
15+
- authn_local:/run/authn-local
1416
depends_on:
1517
- pg
1618

17-
conjur_4:
18-
image: registry2.itci.conjur.net/conjur-appliance-cuke-master:4.9-stable
19-
security_opt:
20-
- seccomp:unconfined
21-
volumes:
22-
- ../features_v4/support/policy.yml:/etc/policy.yml
23-
- authn_local_4:/run/authn-local
24-
2519
gem:
2620
build:
2721
context: ../
2822
dockerfile: dev/Dockerfile.dev
2923
entrypoint: sleep
3024
command: infinity
3125
environment:
32-
CONJUR_APPLIANCE_URL: http://conjur_5
33-
CONJUR_VERSION: 5
26+
CONJUR_APPLIANCE_URL: http://conjur
3427
CONJUR_ACCOUNT: cucumber
3528
links:
36-
- conjur_5:conjur_5
37-
- conjur_4:conjur_4
29+
- conjur:conjur
3830
volumes:
3931
- ..:/src/conjur-api
40-
- authn_local_4:/run/authn-local-4
41-
- authn_local_5:/run/authn-local-5
32+
- authn_local:/run/authn-local
4233

4334
client:
35+
# TODO: Upgrade to V8
4436
image: conjurinc/cli5
4537
entrypoint: sleep
4638
command: infinity
4739
environment:
48-
CONJUR_APPLIANCE_URL: http://conjur_5
40+
CONJUR_APPLIANCE_URL: http://conjur
4941
CONJUR_ACCOUNT: cucumber
5042
CONJUR_AUTHN_LOGIN: admin
5143
links:
52-
- conjur_5:conjur_5
44+
- conjur:conjur
5345

5446
volumes:
55-
authn_local_5:
56-
authn_local_4:
47+
authn_local:

dev/start

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash -ex
22

3-
function v5_development() {
4-
docker compose up -d --no-deps conjur_5 pg gem client
3+
function development() {
4+
docker compose up -d --no-deps conjur pg gem client
55

6-
docker compose exec -T conjur_5 conjurctl wait
6+
docker compose exec -T conjur conjurctl wait
77

8-
local api_key=$(docker compose exec -T conjur_5 rake 'role:retrieve-key[cucumber:user:admin]')
9-
api_key=$(docker compose exec -T conjur_5 conjurctl role retrieve-key cucumber:user:admin | tr -d '\r')
8+
local api_key=$(docker compose exec -T conjur rake 'role:retrieve-key[cucumber:user:admin]')
9+
api_key=$(docker compose exec -T conjur conjurctl role retrieve-key cucumber:user:admin | tr -d '\r')
1010

1111
docker exec -e CONJUR_AUTHN_API_KEY="$api_key" -it --detach-keys 'ctrl-\' $(docker compose ps -q gem) bash
1212
}
@@ -19,4 +19,4 @@ fi
1919
docker compose pull
2020
docker compose build
2121

22-
v5_development
22+
development

0 commit comments

Comments
 (0)