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

Commit

Permalink
Merge branch 'master' into why-udaru
Browse files Browse the repository at this point in the history
Conflicts:
	docs/_sidebar.md
  • Loading branch information
dberesford committed Aug 4, 2017
2 parents b5d668b + c786bd6 commit 065e077
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 47 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ As the Postgresql docker container has its 5432 port forwarded on the local mach
To access the database using the pgAdmin you have to fill in also the container IP beside the database names and access credentials. The container IP can be seen with `docker ps`. Use IP 127.0.0.1 and use postgres as username/password to connect to database server.

### Migrations
We use [`postgrator`][postgrator] for database migrations. You can find the sql files in the [`database/migrations`](/database/migrations) folder. To run the migrations manually:
We use [`postgrator`][postgrator] for database migrations. You can find the sql files in the [`database/migrations`](https://github.com/nearform/udaru/tree/master/database/migrations) folder. To run the migrations manually:

```
node database/migrate.js --version=<version>`
Expand Down Expand Up @@ -247,7 +247,7 @@ Copyright nearForm Ltd 2017. Licensed under [MIT][license].
[swagger-link]: http://localhost:8080/documentation
[SQL Injection]: docs/sqlinjection.md
[sqlmap]: https://github.com/sqlmapproject/sqlmap
[sqlmap config]: ./security/fixtures/injection-endpoints.json
[sqlmap config]: https://github.com/nearform/udaru/blob/master/security/fixtures/injection-endpoints.json
[docs-site]: https://nearform.github.io/udaru
[swagger-docs-url]: https://nearform.github.io/udaru/swagger/

Expand Down
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
homepage: 'https://raw.githubusercontent.com/nearform/udaru/master/docs/overview.md',
alias: {
'\/docs\/(.*)': '/$1', // supports regexp
'/./LICENSE': 'https://raw.githubusercontent.com/nearform/udaru/master/LICENSE.md'
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/swagger/swagger-json.js

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions lib/plugin/config/swagger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const packageJson = require('../../../package.json')

module.exports = {
jsonEditor: true,
reuseDefinitions: false,
grouping: 'tags',
info: {
title: 'Udaru API Documentation',
description: 'This page documents Udaru\'s API endpoints, along with their various inputs and outputs. For more information about Udaru please see the <a href="https://nearform.github.io/udaru">Documentation Site.</a>',
version: packageJson.version
},
tags: [
{
name: 'policies',
description: 'Manage policy objects'
},
{
name: 'organizations',
description: 'Manage organizations'
},
{
name: 'teams',
description: 'Manage teams within an organization'
},
{
name: 'users',
description: 'Manage users within an organization'
},
{
name: 'authorization',
description: 'Manage the actions a user can perform against a resource'
},
{
name: 'private',
description: 'Endpoints that require a service key'
},
{
name: 'monitoring',
description: 'Endpoints for monitoring and uptime'
}
]
}
43 changes: 1 addition & 42 deletions lib/server/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict'

const packageJson = require('../../package.json')
const config = require('../plugin/config')

const Hapi = require('hapi')
Expand All @@ -14,46 +13,6 @@ server.connection({
}
})

const swaggerOptions = {
jsonEditor: true,
reuseDefinitions: false,
grouping: 'tags',
info: {
title: 'Authorization API Documentation',
version: packageJson.version
},
tags: [
{
name: 'policies',
description: 'Manage policy objects'
},
{
name: 'organizations',
description: 'Manage organizations'
},
{
name: 'teams',
description: 'Manage teams within an organization'
},
{
name: 'users',
description: 'Manage users within an organization'
},
{
name: 'authorization',
description: 'Manage the actions a user can perform against a resource'
},
{
name: 'private',
description: 'Endpoints that require a service key'
},
{
name: 'monitoring',
description: 'Endpoints for monitoring and uptime'
}
]
}

server.register(
[
{
Expand All @@ -68,7 +27,7 @@ server.register(
},
{
register: require('hapi-swagger'),
options: swaggerOptions
options: require('../plugin/config/swagger')
},
{
register: require('../plugin')
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
"pg-copy-streams": "^1.2.0",
"pre-commit": "^1.2.2",
"proxyquire": "^1.7.10",
"remark-cli": "^3.0.0",
"remark-cli": "^4.0.0",
"remark-lint": "^6.0.0",
"remark-preset-lint-recommended": "^2.0.0",
"remark-preset-lint-recommended": "^3.0.0",
"standard": "^8.6.0",
"swagger-gen": "^1.1.3"
},
Expand Down

0 comments on commit 065e077

Please sign in to comment.