Skip to content

Commit

Permalink
Merge pull request #108 from dojot/release/v0.4.3
Browse files Browse the repository at this point in the history
Merge  v0.4.3
  • Loading branch information
Mariane Previde committed Sep 4, 2020
2 parents ac73980 + 05fbf58 commit 27b915f
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 18 deletions.
7 changes: 1 addition & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@ services:
- docker
python:
- '3.6'
cache:
directories:
- node_modules
before_install:
- npm install aglio
script:
- 'docker build -t ${TRAVIS_REPO_SLUG} .'
- 'docker build -t dredd-tests . -f ./tests/Dockerfile'
- 'docker-compose -f ./tests/docker-compose.yml up -d auth-redis postgres zookeeper kafka data-broker data-broker-redis'
- 'docker-compose -f ./tests/docker-compose.yml run auth'
after_success:
- travis/publish.sh
- travis/deploy-gh-pages.sh
- travis/deploy-gh-pages.sh
2 changes: 2 additions & 0 deletions docs/apiary.apib
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
HOST: http://localhost:8000/auth

<!-- include(auth.apib) -->
<!-- include(crud-api.apib) -->
<!-- include(relation.apib) -->
Expand Down
9 changes: 5 additions & 4 deletions docs/auth.apib
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ Service is the token that associates the user with the set of devices and flows

## Individual user settings [/user/{id}]
Access a user's authorization and identification information
+ parameters

+ Parameters
+ id: 1 (required, string) - The user ID

### Get user info [GET /user/{id}]
### Get user info [GET]
Retrieves all information from a specific registered user
+ Request
+ Headers
Expand Down Expand Up @@ -181,7 +182,7 @@ Retrieves all information from a specific registered user
}


### Update user info [PUT /user/{id}]
### Update user info [PUT]
Replaces user information. Fields or attributes that are not informed will revert to their defaults.
+ Request (application/json)
+ Headers
Expand Down Expand Up @@ -214,7 +215,7 @@ Replaces user information. Fields or attributes that are not informed will rever
"status": 404
}

### Remove user [DELETE /user/{id}]
### Remove user [DELETE]
Removes a user from the system
+ Request
+ Headers
Expand Down
35 changes: 30 additions & 5 deletions docs/crud-api.apib
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@ also be escaped
"message": "No permission with found this ID"
}

+ Response 404 (application/json)

{
"status": 404,
"message": "No permission with found this ID"
}
+ Response 405 (application/json)

{
"status": 405,
"message": "Can't edit a system permission"
}

### Remove a permission [DELETE]

+ Request
Expand All @@ -136,7 +149,7 @@ also be escaped
Authorization: Bearer JWT

+ Response 200 (application/json)

{
"status": 200,
"message": "ok"
Expand Down Expand Up @@ -171,7 +184,7 @@ also be escaped
}

+ Response 200 (application/json)

{
"status": 200,
"id": 3
Expand All @@ -191,7 +204,7 @@ also be escaped
+ name: testadm (optional, string) - a group name, or part of a group name.

+ Response 200 (application/json)

{
"groups": [
{
Expand Down Expand Up @@ -227,7 +240,7 @@ also be escaped
}

+ Response 404 (application/json)

{
"status": 404,
"message": "No group found with this ID"
Expand All @@ -241,7 +254,7 @@ also be escaped
Authorization: Bearer JWT

+ Body

{
"name": "testadm",
"description" : "projectX"
Expand All @@ -261,6 +274,12 @@ also be escaped
"message": "No group found with this ID"
}

+ Response 405 (application/json)

{
"status": 405,
"message": "Can't edit admin group"
}

### Remove a group [DELETE]
+ Request (application/json)
Expand All @@ -282,3 +301,9 @@ also be escaped
"message": "No group found with this ID"
}

+ Response 405 (application/json)

{
"status": 405,
"message": "Can't delete admin group""
}
7 changes: 5 additions & 2 deletions travis/deploy-gh-pages.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

git remote add -t gh-pages -f origin-gh-pages https://github.com/${TRAVIS_REPO_SLUG}
git fetch origin-gh-pages
git checkout gh-pages
Expand All @@ -12,11 +14,12 @@ then
else
export VERSION="${TRAVIS_BRANCH}"
fi
node_modules/.bin/aglio -i apiary.apib -o apiary_${VERSION}.html

docker run --volume $(pwd):/temp:Z dojot/aglio -i /temp/apiary.apib -o - > ./apiary_${VERSION}.html

git add apiary_${VERSION}.html
git commit -m 'Updating gh-pages' --amend
git push --force http://${GITHUB_TOKEN}:x-oauth-basic@github.com/${TRAVIS_REPO_SLUG} gh-pages
git checkout -- .
git clean -fd
git checkout ${TRAVIS_BRANCH}
git checkout ${TRAVIS_BRANCH}
6 changes: 5 additions & 1 deletion travis/publish.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#!/bin/bash -ex

if [ $TRAVIS_PULL_REQUEST == false ] ; then
version="latest"
if [ $TRAVIS_BRANCH != "master" ] ; then
version=$TRAVIS_BRANCH
fi
tag=$TRAVIS_REPO_SLUG:$version

DOCKER_TAG=$(echo ${version} | sed 's/\(.*\)\/\(.*\)/\1_\2/')

tag=${TRAVIS_REPO_SLUG}:${DOCKER_TAG}

docker login -u="${DOCKER_USERNAME}" -p="${DOCKER_PASSWORD}"
docker tag ${TRAVIS_REPO_SLUG} ${tag}
Expand Down

0 comments on commit 27b915f

Please sign in to comment.