Commit Graph
182 Commits
Author SHA1 Message Date
Todd Knight c44a4c4795 Tools for auth token interception and authentication (#152) 2020-07-07 12:14:26 -07:00
Todd Knight f69d6b9952 Creating Auth Token Repo (#125) 2020-07-07 07:44:49 -07:00
Todd Knight bb4a185412 Pushing test db cleanup up to where the database objects are created using t.Cleanup. (#166) 2020-07-06 10:15:01 -07:00
Jeff Mitchell 316b250a24 Use dockertest v3 consistently (#167) 2020-07-06 12:41:09 -04:00
Todd Knight 2727917b2a Adding List to go SDK (#164) 2020-07-02 10:26:31 -07:00
Todd Knight c017da7087 Add ListUsers handler implementation. (#160) 2020-07-02 08:17:52 -07:00
Jim d0a846823a support for NewOplogMsgs() option when calling CreateItems and DeleteItems (#158) 2020-07-01 05:40:02 -04:00
Jeff Mitchell c965cf1bc5 Attempt to fix content-length header in index (#159) 2020-06-30 17:37:24 -04:00
Todd Knight 9a1539867e Adding SDK ability to do CRUD operations on groups and roles under the project scope. (#157) 2020-06-30 10:25:58 -07:00
Jeff MitchellandRandall Morey 8da4effd5e Add mechanism for bundling UI assets. (#153)
* Add mechanism for bundling UI assets.

The scripts/uigen.sh script will check out the UI repo, build assets,
create a static assets file, and clean up.

The dev Makefile target has been modified to run this script if no
assets file is found. There is also a build-ui target that will
unilaterally update (the dev target only builds if the file isn't found,
but doesn't update).

The handler has been updated to add the default org ID as a header if
the request path is "/".

Co-authored-by: Randall Morey <randall@randallmorey.com>
2020-06-30 11:26:22 -04:00
Jim 8d8bb42418 add CreateItems and DeleteItems to writer interface (#156) 2020-06-29 19:28:15 -04:00
Todd Knight 8399764442 Roles and Groups Handlers Support Project Scope (#154)
* Adding project level scopes for groups and roles.

* Adding tests to verify the routes are working as expected.
2020-06-29 11:12:40 -07:00
Jim 3e3144117e iam and auth integration (#144) 2020-06-29 08:18:57 -04:00
Jim 3d85c7ebb0 add CreateItems() and DeleteItems() (#146) 2020-06-29 06:36:00 -04:00
Jim 9a87df38c7 add CreateItems() and DeleteItems() (#146) 2020-06-29 06:31:23 -04:00
Michael Gaffney d69588131c Fix for panic in db.setFieldsToNil (#155) 2020-06-28 16:55:57 -04:00
Todd Knight 08e9a027fa API for authenticate/deauthenticate (#151)
* Creating the authentication API.
2020-06-26 15:41:08 -07:00
Jeff Mitchell d8f11af4d7 Move actions, resource (types), and scopes to packages. (#149) 2020-06-26 11:00:14 -04:00
Jeff Mitchell 9d1d0ba08e Simplify UI passthrough logic (#148)
I realized we can handle the special case of `/index.html` by ensuring
that `/` does the right thing because that's _also_ standard behavior to
fetch `/index.html`. As a result this allows a lot of simplification.
2020-06-25 15:03:03 -04:00
Jeff Mitchell 94f66c9ee6 Fix test function breakage after merging encrypted config 2020-06-25 12:16:59 -05:00
Jeff Mitchell 16b56a37ed Rename base.New -> base.NewCommand for clarity 2020-06-24 15:10:12 -05:00
Jeff Malnick 8afcbd4c8e Add config CLI command and encrypt/decrypt sub-commands (#77) 2020-06-24 16:08:13 -04:00
Jeff Mitchell 8de5371499 Enable UI handling logic with dev passthrough directories. (#145)
* Enable UI handling logic with dev passthrough directories.

* Add tests and fix a couple of things
2020-06-24 16:06:19 -04:00
Jim 6641244734 add support for WithVersion option to updates (#126) 2020-06-24 12:33:49 -04:00
Michael Gaffney c110c86ee5 Add function to check if db error is a check constraint violation (#142) 2020-06-23 18:00:50 -04:00
Jeff Malnick 6c2a17c845 feat: use root path for passthrough (#141) 2020-06-23 10:34:07 -07:00
Jeff Mitchell 993a6f1680 Remove "projects" from grant strings (#143)
This removes the ability for a grant string to switch projects, in
accordance with our updated design. It mostly removes code, with a few
test fixes, and also adds one additional check (and test) to ensure a
grant errors rather than do-nothing succeeds if both id and type are
empty.
2020-06-23 11:28:44 -04:00
Todd Knight a02222c1f0 Adding List functionality for projects. (#140) 2020-06-23 07:04:44 -07:00
Todd Knight 0c8385b423 Updating TxHandler to accept a reader as well in order to support reads inside the same transactions as writes. (#139) 2020-06-22 13:27:26 -07:00
Michael Gaffney 6908f7a7a2 Use standard column names (#138) 2020-06-22 13:54:55 -04:00
Todd Knight 766c174fe9 Implement List Groups (#133)
* Implement List Groups

* Updating ListGroup's comments and tweaking variable name.
2020-06-22 10:46:45 -07:00
Todd Knight 5b1e4a680d Create Role CUDLR API and SDK (#135)
* Implement the Role CRUD API.

* Implement the Role List API.

* Adding Roles SDK.
2020-06-22 06:56:27 -07:00
Michael Gaffney 1023c90729 Enforce auth_account to iam_user plus iam_scope constraints (#137) 2020-06-21 13:16:03 -04:00
Todd Knight 0a0d37668d Org List and Get API Methods (#132)
* Create the organization Get handler.

* Added org listing.

* Make sure the cmp.Diff always sorts the returned organizations before comparing.

* Connect organization service to the Controller handler.
2020-06-19 10:55:50 -07:00
Michael Gaffney 0ebb38bbe5 auth method schema (#131)
* Rename iam migrations to 06

* Add base tables for auth methods and auth accounts

* Add triggers for auth_method and auth_account subtypes
2020-06-19 13:10:05 -04:00
Jim ed60cac7fe add listing for groups and roles (#130) 2020-06-19 12:06:25 -04:00
Jim 1974e355c8 delete all users at the start of each test. (#129) 2020-06-19 11:27:35 -04:00
Jim c413e013bd get oplog Ticket before writing data (#127) 2020-06-18 21:24:55 -04:00
Jim 342bef7767 listing projects and organizations (#124) 2020-06-18 14:53:11 -04:00
Jim d9073a03d5 listing users (#118) 2020-06-16 18:59:30 -04:00
Todd Knight 6ea448a7f3 Adding Groups API endpoint and SDK (#122)
* feat: Add group grpc handler.

* feat: Add group sdk hooks.

* fix:  Adding forgotten generated group sdk file.

* fix:  Fix a copy/paste error in test msg.

* fix:  Correct assert error msg.

* fix: Remove unused proto imports.
2020-06-15 15:22:41 -07:00
Jim ffddf24f86 iam roles (#116) 2020-06-15 12:42:08 -04:00
Todd Knight 1637403624 fix: Removing unused imports and proto files. (#119) 2020-06-13 18:36:05 -07:00
Michael Gaffney 2d650b241d Fix down migrations (#120)
* Fix iam down migrations

* Fix '03_db' down migrations

* Fix oplog down migrations

* Fix domain down migrations

* Run make gen
2020-06-13 07:20:40 -04:00
Jim cc5114bdef refactor scopes to conform to public id usage and repo error msgs (#117) 2020-06-12 15:22:23 -04:00
Jim 5c2cff3ad2 iam groups (#112) 2020-06-11 16:36:47 -04:00
Michael Gaffney 4f30983c14 Bump deps and run make gen (#115) 2020-06-11 10:08:54 -04:00
Jeff Mitchell f41bf6e31e Add permission grant string parsing and validation and ACL implementation (#109)
This adds parsing and validation for grant strings along with the ability to create canonical JSON and text strings from a grant.

It also adds an ACL implementation, allowing a collection of grant strings to then be checked against a resource/action tuple and indicate if it's allowed.

Note that only specific sets of provided data in grant strings is allowed. This vastly simplifies logic.

Test coverage is 100%.

A future update will consolidate and migrate types between this and IAM but I didn't want to mix that in with this.
2020-06-10 17:58:52 -04:00
Jim 10e08e90f0 cleanup tests: properly use require, catch defer errors, use testing functions (#113) 2020-06-10 12:10:34 -04:00
Michael Gaffney ce166c0bdf Use dbassert package (#114)
Removes direct dependency on gorm in tests.
2020-06-10 09:06:41 -04:00