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

Reconciled lerna package split #444

Merged
merged 63 commits into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d451cdd
Split code into 4 packages using lerna.
Nov 14, 2017
5808a60
Merge branch 'lerna-ize' of git://github.com/wprl/udaru into wprl-ler…
dberesford Jan 26, 2018
b02d0de
Reconsiled master merge out to wprl:lerna-ize (https://github.com/nea…
dberesford Jan 26, 2018
68c5cc7
feat: get user teams, no inheritance
Feb 2, 2018
2161064
fix: get user teams functionality, tests
Feb 3, 2018
fd86d21
chore: changes feedback review
Feb 5, 2018
d011146
Merge pull request #451 from nearform/feat/user-teams
mihaidma Feb 5, 2018
585db5e
chore: release 3.1.0 preps
Feb 5, 2018
79b04de
Merge pull request #452 from nearform/release-preps
mihaidma Feb 5, 2018
7b78c59
fix: allow empty results when the user is in no teams
Feb 6, 2018
139d2e1
volume data insertion and autocannon bench tests
cianfoley-nearform Feb 12, 2018
80c070c
database migration to 6, added index to team_members, fixed bug in vo…
cianfoley-nearform Feb 13, 2018
91c5ffa
updated NUM_TEAMs in config to 500
cianfoley-nearform Feb 13, 2018
c38843d
Forking child process for UDARU server in volumeRunner
cianfoley-nearform Feb 14, 2018
0a500ec
Merge pull request #454 from nearform/fix/get-teams
mihaidma Feb 15, 2018
724de00
tidy ups and upgraded lodash to 4.17.5
cianfoley-nearform Feb 15, 2018
3a065d5
added chalk to volume load/test, using IPC when forking server, updat…
cianfoley-nearform Feb 15, 2018
252f70e
updated intermittently failing user policies test cases
cianfoley-nearform Feb 15, 2018
6208356
Merge branch 'master' into volume-fixtures-and-autocannon
cianfoley-nearform Feb 16, 2018
978ea10
Merge pull request #456 from nearform/volume-fixtures-and-autocannon
mihaidma Feb 16, 2018
b34fb88
updated pbac version, iam.js also changed as the param order is impor…
cianfoley-nearform Feb 16, 2018
7a7d45b
support for optional metadata field, team, user, org read only
cianfoley-nearform Feb 19, 2018
f275b48
get, post and put updated for optional metadata field
cianfoley-nearform Feb 19, 2018
9cbe943
test cases on core added for create, update, read
cianfoley-nearform Feb 19, 2018
42268a6
#450 solved: authorization pre-check required on teams payload object
cianfoley-nearform Feb 20, 2018
7ee09a0
version 3.2.0 not 3.2.1
cianfoley-nearform Feb 20, 2018
534787f
updates to validatation models for better swagger definitions, enforc…
cianfoley-nearform Feb 25, 2018
a485077
added test for issue #475 (invalid effect data)
cianfoley-nearform Feb 26, 2018
1484954
added a note to pagedteamslist to state policies and users not populated
cianfoley-nearform Feb 26, 2018
ece3eed
updates to all entities to throw 409 conflict instead of 400 for db i…
cianfoley-nearform Feb 27, 2018
247408d
Merge pull request #460 from nearform/update-pbac-version
mihaidma Feb 28, 2018
1d72f1a
fix migrate 7 uninstall script
cianfoley-nearform Feb 28, 2018
30fff68
pre-merge issues addressed
cianfoley-nearform Mar 1, 2018
243c7c0
fix: add request id for the resource builder
Mar 1, 2018
99c9f34
Merge pull request #478 from nearform/fix/get-user-teams
mihaidma Mar 1, 2018
124d081
Merge pull request #466 from nearform/445-add-metadata-field-to-entities
mihaidma Mar 1, 2018
c0d4597
chore: bump package, update changes
Mar 1, 2018
eb91963
update to changes.md summary for 4.0.0
cianfoley-nearform Mar 1, 2018
34e7013
Merge pull request #479 from nearform/release_preps
mihaidma Mar 1, 2018
5b39756
chore: package lock update
Mar 1, 2018
7212146
removing public schema from migration scripts
cianfoley-nearform Mar 2, 2018
ea43396
updated version number in package.json and added 4.0.1 entry to changes
cianfoley-nearform Mar 2, 2018
6655a2c
Merge pull request #481 from nearform/fixes-for-v4.0.0
mihaidma Mar 2, 2018
cc2f1e6
support search teams in udaru core
jimmymintzer Feb 21, 2018
4dc5b7e
search team endpoint and search logic updates
jimmymintzer Feb 22, 2018
d2481c1
add total to team search response
jimmymintzer Feb 22, 2018
09f18e5
update search response validation to match actual response data
jimmymintzer Feb 22, 2018
a8a33a6
Merge pull request #473 from nearform/search-teams
cianfoley-nearform Mar 5, 2018
1371578
Nested Teams Endpoint (#477)
jimmymintzer Mar 7, 2018
65a7cdf
Reset version to 4.0.1, it had accidently been set to 4.2.0
dberesford Mar 8, 2018
7c930f1
check if team exists before returning users, check if user exist befo…
jimmymintzer Mar 9, 2018
bfc1fa2
fix typo
jimmymintzer Mar 9, 2018
cc62d2b
Example extended to demonstrate teams (#483)
dberesford Mar 10, 2018
f328809
Support in udaru core for searching users (#463)
dberesford Mar 12, 2018
2bb7a4d
Migration to nearForm SQL module
IvanJov Mar 14, 2018
41fb57f
Removed postgrator
IvanJov Mar 14, 2018
6a36a9c
Removed postgrator
IvanJov Mar 14, 2018
52a4492
Split code into 4 packages using lerna.
Nov 14, 2017
4e58015
lerna package updates and merge conflicts resolved
cianfoley-nearform Mar 14, 2018
a1ef58d
merged sql module updated
cianfoley-nearform Mar 15, 2018
0894947
Merge remote-tracking branch 'origin/user-teams-exist' into wprl-lern…
cianfoley-nearform Mar 15, 2018
42aec73
packages/udaru/ -> packages/udaru-core/
cianfoley-nearform Mar 15, 2018
4065f6b
update version in changes.md, packages and static swagger docs
cianfoley-nearform Mar 16, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.DS_Store

*.log
docs/coverage.html
coverage.html
sqlmap

node_modules
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ services:

before_script:
- psql -c 'create database "authorization";' -U postgres
- lerna bootstrap

script:
- npm run test:commit-check
Expand Down
26 changes: 13 additions & 13 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@

## 3.0.0 - January 22, 2018
Features, enhancements:
- Shared policies [commit](https://github.com/nearform/udaru/pull/437)
- Policy templates [commit](https://github.com/nearform/udaru/pull/435)
- Multi variable policies [commit](https://github.com/nearform/udaru/pull/441)
- Create Udaru instance only on demand [commit](https://github.com/nearform/udaru/pull/440)
- Explicitely add org header for CORS [commit](https://github.com/nearform/udaru/pull/434)
- Remove core instance dependency at plugin level [commit](https://github.com/nearform/udaru/pull/433)
- Enhanced configuring, extract DB pool creation [commit](https://github.com/nearform/udaru/pull/427)
- Endpoint for listing allowed actions on multiple resources [commit](https://github.com/nearform/udaru/pull/418)
- Updated dependencies
- Documentation udpates
- Shared policies [commit](https://github.com/nearform/udaru/pull/437)
- Policy templates [commit](https://github.com/nearform/udaru/pull/435)
- Multi variable policies [commit](https://github.com/nearform/udaru/pull/441)
- Create Udaru instance only on demand [commit](https://github.com/nearform/udaru/pull/440)
- Explicitely add org header for CORS [commit](https://github.com/nearform/udaru/pull/434)
- Remove core instance dependency at plugin level [commit](https://github.com/nearform/udaru/pull/433)
- Enhanced configuring, extract DB pool creation [commit](https://github.com/nearform/udaru/pull/427)
- Endpoint for listing allowed actions on multiple resources [commit](https://github.com/nearform/udaru/pull/418)
- Updated dependencies
- Documentation udpates

Fixes:
- **Breaking change: solutions using 2.0 can't migrate DB to 3.0**: Fix migration issue [commit](https://github.com/nearform/udaru/pull/438)
- Fix not existing user got authorized [commit](https://github.com/nearform/udaru/pull/429)
- Fix db init script [commit](https://github.com/nearform/udaru/pull/432)
- **Breaking change: solutions using 2.0 can't migrate DB to 3.0**: Fix migration issue [commit](https://github.com/nearform/udaru/pull/438)
- Fix not existing user got authorized [commit](https://github.com/nearform/udaru/pull/429)
- Fix db init script [commit](https://github.com/nearform/udaru/pull/432)

## 2.0.3 - August 24, 2017
Fixed Udaru plugin registration [commit](https://github.com/nearform/udaru/commit/c893346c026d6f87873685b70b2e0e63f475978a)
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![snyk][snyk-badge]][snyk-url]

![Udaru](./docs/logo.jpg)
Udaru is an Policy Based Access Control (PBAC) authorization module. It supports Organizations, Teams and User entities that are used to build the access model. The policies attached to these entities define the 'Actions' that can be performed by an entity on various 'Resources'.
Udaru is a Policy Based Access Control (PBAC) authorization module. It supports Organizations, Teams and User entities that are used to build the access model. The policies attached to these entities define the 'Actions' that can be performed by an entity on various 'Resources'.

See the Udaru [website](https://nearform.github.io/udaru/) for complete documentation on Udaru.

Expand Down Expand Up @@ -33,7 +33,7 @@ npm run start
### Hapi plugin
```js
const Hapi = require('hapi')
const UdaruPlugin = require('udaru/plugin')
const UdaruPlugin = require('udaru-hapi-plugin')

...

Expand Down Expand Up @@ -143,7 +143,7 @@ and then go to [`http://localhost:8080/documentation`][swagger-link]
The Swagger documentation also gives the ability to execute calls to the API and see their results. If you're using the test database, you can use 'ROOTid' as the required authorization parameter and 'WONKA' as the organisation.

### ENV variables to set configuration options
There are three default configuration files, one per "level": [`lib/config/default.core.js`][core-config], [`lib/config/default.plugin.js`][plugin-config] and [`lib/config/default.server.js`][server-config].
There are three default configuration files, one per "level": [`packages/udaru/config.js`][core-config], [`packages/udaru-hapi-plugin/config.js`][plugin-config] and [`packages/udaru-server/config.js`][server-config].

They are cumulative: when running udaru as a standalone server all the three files will be loaded; when using it as an Hapi plugin, plugin and core will be loaded.

Expand All @@ -169,7 +169,7 @@ const udaru = buildUdaru(dbPool, {
**Hapi plugin**
```js
const Hapi = require('hapi')
const UdaruPlugin = require('udaru/plugin')
const UdaruPlugin = require('udaru-hapi-plugin')
const server = new Hapi.server()
server.register({
register: UdaruPlugin,
Expand Down Expand Up @@ -247,7 +247,7 @@ To run a bench test on a given route:
npm run bench -- "METHOD swagger/route/template/path"
```

To obtain a coverage report:
To create coverage reports:

```
npm run coverage
Expand Down Expand Up @@ -277,9 +277,9 @@ See the [sqlmap][] repository for more details.

Copyright nearForm Ltd 2017. Licensed under [MIT][license].

[core-config]: https://github.com/nearform/udaru/blob/master/lib/config/default.core.js
[plugin-config]: https://github.com/nearform/udaru/blob/master/lib/config/default.plugin.js
[server-config]: https://github.com/nearform/udaru/blob/master/lib/config/default.server.js
[core-config]: https://github.com/nearform/udaru/blob/master/packages/udaru/config.js
[plugin-config]: https://github.com/nearform/udaru/blob/master/packages/udaru-hapi-plugin/config.js
[server-config]: https://github.com/nearform/udaru/blob/master/packages/udaru-server/config.js
[license]: ./LICENSE.md
[postgrator]: https://github.com/rickbergfalk/postgrator
[prefix-link]: https://github.com/nearform/udaru/blob/master/lib/core/config.js#L100
Expand Down
2 changes: 0 additions & 2 deletions database/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion database/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const _ = require('lodash')
const async = require('async')
const pg = require('pg')
const config = require('../lib/config/build-all')()
const config = require('../packages/udaru/config')()

if (!config.get('local')) {
console.error('ERROR: You are trying to init the database while not in local environment.')
Expand Down
2 changes: 1 addition & 1 deletion database/loadTestData.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const path = require('path')
const pg = require('pg')
const fs = require('fs')
const config = require('../lib/config/build-all')()
const config = require('../packages/udaru/config')()

if (!config.get('local')) {
console.error('ERROR: You are trying to load test data in the database while not in local environment.')
Expand Down
2 changes: 1 addition & 1 deletion database/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const postgrator = require('postgrator')
const path = require('path')
const minimist = require('minimist')
const config = require('../lib/config/build-all')()
const config = require('../packages/udaru/config')()

postgrator.setConfig({
migrationDirectory: path.join(__dirname, '/migrations'),
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2'
services:
database:
build: ./database
image: postgres:10
ports:
- 5432:5432
volumes_from:
Expand All @@ -17,4 +17,4 @@ services:
command: "true"
volumes:
psqlvolumes:
driver: local
driver: local
28 changes: 13 additions & 15 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Udaru is open source (MIT License) sponsored by [nearForm](https://www.nearform.

Please see the [README](<https://github.com/nearform/udaru>) for how to get started, running Udaru, testing Udaru, etc. Use [GitHub](<https://github.com/nearform/udaru/issues>) for any bugs, issues, or feature requests.

For general documentation, see the [Udaru Website](<https://nearform.github.io/udaru/>). If you have any feedback on Udaru, [please get in touch](<https://github.com/nearform/udaru/issues>).
For general documentation, see the [Udaru Website](<https://nearform.github.io/udaru/>). If you have any feedback on Udaru, [please get in touch](<https://github.com/nearform/udaru/issues>).

## Core committers - how to release

Expand All @@ -14,25 +14,23 @@ We are currently supporting node 6.

1. Review github issues, triage, close and merge issues related to the release.
2. Update the CHANGES.md file.
3. Navigate to the [Test Rig][Test] and ensure all test are passing.
3. Navigate to the [Test Rig][Test] and ensure all tests are passing.
4. Pull down the repository locally on the master branch.
5. Ensure there are no outstanding commits and the branch is clean.
6. Run `npm install` and ensure all dependencies correctly install.
7. Run `npm outdated` to and review all dependencies.
8. Run `npm update` to get all non breaking updates. We have a policy of using '^' for all dependencies in the package.json and using npm shrinkwrap for each release.
9. Run `npm outdated` again to review possible breaking and major revision updates.
10. Create a github issue for any major update were appropriate.
11. Run `npm run test` and ensure testing and linting passes.
6. Run `npm install` and verify that root level and package dependencies correctly install.
7. Run `npm run outdated:all` and review all dependencies.
8. Run `npm run update:all` to get all non breaking updates. We have a policy of using '^' for all dependencies in the package.json and using npm shrinkwrap for each release.
9. Run `npm run outdated:all` again to review possible breaking and major revision updates.
10. Create a github issue for any major update where appropriate.
11. Run `npm test` and ensure testing and linting passes.
12. Run `npm shrinkwrap`.
13. Run `npm run swagger-gen` to regenerate the Swagger documentation for the Udaru [documentation site][docs-site].
14. Run `git add` and `git commit` to commit any version and documentation changes if there are any.
15. Run `npm version x.x.x -m "version x.x.x"` where `x.x.x` is the version.
16. Run `git push upstream master --tags`
17. Run `npm publish`
18. Go to the [Github release page][Releases] and hit 'Draft a new release'.
19. Paste the Changelog content for this release and add additional release notes.
20. Choose the tag version and a title matching the release and publish.
21. Notify core maintainers of the release via email.
15. Run `lerna publish` and choose the approriate version change type. This will update each package.json of modified packages as appropriate, create a new git commit and tag, and publish updated packages to npm.
16. Go to the [Github release page][Releases] and hit 'Draft a new release'.
17. Paste the Changelog content for this release and add additional release notes.
18. Choose the tag version and a title matching the release and publish.
19. Notify core maintainers of the release via email.

[Test]: https://travis-ci.org/nearform/udaru
[Releases]: https://github.com/nearform/udaru/releases
Expand Down
11 changes: 9 additions & 2 deletions docs/swagger/oauth2-redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
var redirectUrl = oauth2.redirectUrl;
var isValid, qp, arr;

qp = (window.location.hash || location.search).substring(1);
if (/code|token|error/.test(window.location.hash)) {
qp = window.location.hash.substring(1);
} else {
qp = location.search.substring(1);
}

arr = qp.split("&")
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';})
Expand All @@ -23,7 +27,10 @@

isValid = qp.state === sentState

if (oauth2.auth.schema.get("flow") === "accessCode" && !oauth2.auth.code) {
if ((
oauth2.auth.schema.get("flow") === "accessCode"||
oauth2.auth.schema.get("flow") === "authorizationCode"
) && !oauth2.auth.code) {
if (!isValid) {
oauth2.errCb({
authId: oauth2.auth.name,
Expand Down
2 changes: 1 addition & 1 deletion docs/swagger/swagger-json.js

Large diffs are not rendered by default.

42 changes: 30 additions & 12 deletions docs/swagger/swagger-ui-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/swagger/swagger-ui-bundle.js.map

Large diffs are not rendered by default.

Loading