Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Commit

Permalink
Update expiration for host-factory token, this fixes the test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin Collins committed Apr 18, 2018
1 parent 4a6a436 commit c684862
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 38 deletions.
37 changes: 12 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,43 +1,30 @@
.PHONY: nodejs-image cli-image
.PHONY: apidocs-image cli-image

default: nodejs-image cli-image api.md
default: apidocs-image cli-image api.md

test: nodejs-image api.md
test: apidocs-image api.md
echo "Running tests against container '$(CONJUR_CONTAINER)'"
summon docker run \
--rm \
summon docker run --rm -v $(PWD):/app \
--link $(CONJUR_CONTAINER):conjur \
-v $(PWD):/app \
-e NODE_TLS_REJECT_UNAUTHORIZED=0 \
--env-file @SUMMONENVFILE \
apidocs \
/dredd
./dredd

names: nodejs-image api.md
names: apidocs-image api.md
echo "Enumerating transaction names"
docker run \
--rm \
-v $(PWD):/app \
apidocs \
dredd \
./api.md \
https://conjur \
--names

docker run --rm -v $(PWD):/app apidocs \
dredd ./api.md https://conjur --names

preview: api.md
rvm use --create 2.2.4@apidocs
bundle
apiary preview --server --port=8081 --path api.md

api.md: nodejs-image src/* src/partials/*
docker run \
--rm \
-v $(PWD):/app -w /app \
apidocs \
api.md: apidocs-image src/* src/partials/*
docker run --rm -v $(PWD):/app -w /app apidocs \
hercule src/api.md -o api.md

nodejs-image:
apidocs-image:
docker build -t apidocs .

cli-image:
docker build -t apidocs-conjur-cli -f Dockerfile.cli .
2 changes: 1 addition & 1 deletion src/host_factory.tokens.create.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Generate multiple tokens at once with the `count` parameter. By default, one tok

+ Parameters
+ id: redis (string) - ID of the host factory, query-escaped
+ expiration: `2017-12-16T14:36:57-05:00` (string) - Expiration timestamp (ISO8601), query-escaped
+ expiration: `2025-12-16T14:36:57-05:00` (string) - Expiration timestamp (ISO8601), query-escaped
+ count: 2 (number, optional) - Number of tokens to create
+ cidr%5B%5D: 172.17.0.0/16 (string, optional) - addresses to restrict tokens to

Expand Down
15 changes: 3 additions & 12 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,9 @@ cid=$(docker run -d --privileged -P -v $PWD:/src ${DOCKER_IMAGE})

docker exec -i $cid /opt/conjur/evoke/bin/wait_for_conjur

ssl_certificate=$(docker exec ${cid} cat /opt/conjur/etc/ssl/conjur.pem)

make cli-image

docker run --rm --privileged\
-v $PWD:/src -w /src \
-e CONJUR_SSL_CERTIFICATE="${ssl_certificate}" \
-e CONJUR_AUTHN_LOGIN=admin \
-e CONJUR_AUTHN_API_KEY=secret \
--link ${cid}:cuke-master \
apidocs-conjur-cli conjur rubydsl load ./test/policy.rb
# Log in as admin and load test policy
docker exec -i $cid conjur authn login -u admin -p secret
docker exec -i $cid conjur rubydsl load /src/test/policy.rb

export CONJUR_VERSION

CONJUR_CONTAINER=${cid} make test

0 comments on commit c684862

Please sign in to comment.