Commit Graph
57 Commits
Author SHA1 Message Date
Jeff Mitchell 717a3b52ee Add worker tagging (#862)
This allows workers to have tags assigned to them, which can then be filtered to control which targets they are allowed to serve.
2021-01-21 16:27:20 -05:00
Jeff Mitchell dcb15cffbd Add authorized actions output on resources (#870) 2021-01-20 10:53:01 -05:00
Todd Knight ec6151d174 Organize DB Schema Migration Code and DB Init Checks (#842)
Create Schema Manager and propagate contexts into the DB calls downstream.
Add checks at controller startup and database init for correct schema version and schema migration dirty bit being set.
2021-01-19 10:40:41 -07:00
Jeff Mitchell 9de928318d Skip curl output when using automatic versioning and reading (#858)
This makes it so that the actual output is the update/delete.

Fixes #856
2021-01-08 17:30:41 -05:00
Jeff Mitchell 84c617dc49 Run make gen after the gofumpt update 2021-01-08 10:32:02 -05:00
Michael GaffneyandJeff Mitchell 94cb79bbdd See how Boundary would look with gofumpt applied (#853)
* See how Boundary would look with https://github.com/mvdan/gofumpt applied

Results of running `gofumpt -w -s .`

* Update tools file and Makefile for gofumpt

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2021-01-07 10:02:32 -05:00
Jeff Mitchell f8577519b6 Prep for 0.1.4 2021-01-05 09:26:21 -05:00
Jeff Mitchell 0614559f80 Prep for 0.1.3 2020-12-17 15:26:59 -05:00
Jeff Malnick 1b697b7bce Update docker build to 0.1.2 (#793)
* build: use 0.1.2 for docker build

* feat: tag latest when tagging new docker release
2020-11-19 16:15:19 -08:00
Louis Ruch aa655f6991 Revert errorid (#797)
* Revert "Refactor domain error to use errorId (#790)"

This reverts commit d30dd0ff64.

* Revert "Create common errorID generation (#788)"

This reverts commit b8a5b9adf1.
2020-11-19 12:46:15 -08:00
Louis Ruch b8a5b9adf1 Create common errorID generation (#788) 2020-11-16 13:51:11 -08:00
Todd Knight 6e5aff3d5b Add buf breaking change detection to makefile (#756)
* Add buf breaking change detection to makefile.

* Bump buf version to latest and fixed some deprecation and new flag warnings.
2020-11-02 12:21:20 -07:00
Jeff Malnick 038540f9ad feat: add official Dockerfile for Boundary (#755) 2020-10-29 08:44:57 -07:00
Jeff Mitchell 7f00e61ab0 Migrate to newer grpc utilities and bump deps (#593)
* Migrate to newer grpc utilities and bump deps

* Revert grpc back as it was an accidental tag
2020-10-09 13:18:53 -04:00
Sam Salisbury 560c727bcf make update-ui-version (#578)
* make update-ui-version

* make update-ui-version: default branch main

* make update-ui-version: actually checkout commit
2020-10-08 18:51:53 +01:00
Jeff Mitchell 5cbfcf8eb6 Shuffle things around out of new modules 2020-10-07 14:03:42 -04:00
Jeff Mitchell 0f7444a690 Create the perms table and a program to keep it up-to-date (#529) 2020-10-04 21:41:21 -04:00
Sam Salisbury 498a840862 Add packagespec CI (#479) 2020-09-28 17:15:28 +01:00
Jeff Mitchell 919a4d76cf Add bin target and update version_base 2020-09-25 17:44:50 -04:00
Jim f29869b715 support for additional deks: oplog, session and token and new CreateKeysTx() (#321) 2020-09-02 14:37:19 -04:00
Jim f3dd62d5d8 database DEKs (#317) 2020-09-02 07:42:03 -04:00
Jim fcb61d4b67 targets repo (#298) 2020-08-26 13:58:46 -04:00
Jim 9570897032 basic keys mgmt repo (#264) 2020-08-19 16:47:18 -04:00
Michael Gaffney 7d133878be Add base types for host catalog, host set, and host (#272)
* Move static host migrations to higher number

* Add wt_host_address domain type

* Add base tables for host catalog, host set, and host

* Reformat create trigger statements

* Add subtype triggers for host catalog, host set, and host

* Remove wt_host_address domain type

* Rename columns in host_set_member

* Add delete trigger functions for base types

* Add delete after triggers to static host subtypes

* Add protobufs for host base types
2020-08-17 11:00:41 -04:00
Jeff Mitchell 203e2b5dc2 Initial worker porting steps (#232) 2020-08-12 00:40:39 -04:00
Jeff Mitchell 6661117d4c The name. The name. The name! 2020-08-10 17:15:02 -04:00
Jim 1c836c430b support for associating/disassociating an auth account with a user (#233) 2020-08-10 15:17:15 -04:00
Michael Gaffney c163d790a4 Add configuration settings for Argon2 password KDF (#217)
* Bump generated proto code

* Add argon2 conf sql and proto files

* Add generated code for argon2 conf

* Add Resources for Argon2 configuration

* Add get and set Configuration to repository

* Add current config reference to AuthMethod

* Fix authmethod_test

* Fix TestAccount_New

* Add WithConfiguration to options

* Add sql views for current configuration

* Fix SetTableName

* Remove duplicate testAccounts function

* Make tests clearer

* Fix comment

* Rename test variable

* Use NewPrivateId function for private Ids

* Refactor: rename public_id to private_id for password_conf and password_credential

* Remove bad comment

* Check if embedded argon2 configuration is nil

* Add checks around the WithConfiguration option

* Use spaces not tabs in proto file

* Add doc to explain choice of oplog ticket

* Verify oplog in test
2020-07-29 07:58:19 -04:00
Jeff Malnick ccb19caf1e test: add ability to run tests in ci as status checks (#219) 2020-07-24 20:37:44 -07:00
Jeff Malnick 4fa8c5415b docs: add docs site outline with placeholder files (#215) 2020-07-24 15:10:34 -07:00
Michael Gaffney 7897c1cf52 Add base resources for password authentication (#213)
* Add base SQL and protobuf files

* Add options and public Ids

* Add AuthMethod and Account resources

* Add repository

* Add CreateAuthMethod to repository

* Add CreateAccount method to repository

* Remove redundant foreign keys

* Document relationships between iam and auth tables

* Document relationships between auth and auth_password tables

* Add documentation for subtype triggers

* Use wt_scope_id domain type for scope_id

* Refactor: move test helper function

* Remove check from SetTableName

* Remove check from another SetTableName

* Use org scope in tests

* Remove handling of CreateTime and UpdateTime from docs
2020-07-24 10:23:35 -04:00
Todd Knight f47046f158 Update Watchtower to use grpc-gateway v2 (#204)
* Migration to grpc gateway v2.
2020-07-23 11:26:15 -07:00
Jeff Mitchell 65dc095fbc Remove another duplicated entry 2020-07-22 21:45:58 -04:00
Jeff Mitchell b1937c3b18 Remove duplicated inject tag statement in Makefile 2020-07-22 21:38:30 -04:00
JimandJeff Mitchell 260703febe add group member capabilities (#178)
* add group member capabilities

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2020-07-10 19:01:23 -04:00
bcdcaffa6f Port over 162 and 165 to master (#176)
Co-authored-by: Jim Lambert <jlambert@hashicorp.com>
Co-authored-by: Michael Gaffney <mgaffney@users.noreply.github.com>
2020-07-10 15:46:26 -04:00
Jim 6c1b45f7f5 add principal roles (users and groups) to iam (#163) 2020-07-08 17:02:01 -04:00
Jeff Mitchell 8987d8d435 Separate out ui handler under build tag (#170) 2020-07-07 16:57:54 -07:00
Todd Knight f69d6b9952 Creating Auth Token Repo (#125) 2020-07-07 07:44:49 -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 3e3144117e iam and auth integration (#144) 2020-06-29 08:18:57 -04:00
Jim ffddf24f86 iam roles (#116) 2020-06-15 12:42:08 -04:00
Jim 5c2cff3ad2 iam groups (#112) 2020-06-11 16:36:47 -04:00
Jim 7d4993fb61 iam users (#96) 2020-06-04 20:05:08 -04:00
0c7f6da936 Static Host Catalog (#51)
* database: add wt_public_id domain type

* static-hosts: add migrations

* Rename migrations

* migrations: add description column and fix foreign keys

* Add protobuf for static host

* Add HostCatalog and HostSet

* Add Options

* Add foreign key constraint

* Add package doc

* Add copied scanner code

* Add NewHostCatalog with tests

* Override default table name for static host catalog

* WIP: save static host catalog to database

* WIP: Print db url for debugging

* Add iam test helper function

* Make gorm default to null for names and descriptions

* Add foreign key constraint from host catalog to scope

* Names are not needed for the test org and project

* Avoid an ordering dependency in down migrations

* Use wt_timestamp

* Add check constraint on host address column

* Add Host

* Add HostSet

* Add HostSetMember

* Test a HostSetMember can be written to the database

* Move the getters and setters for table name to a new file

The TableName methods are needed by gorm and the SetTableName methods
are for oplog. Moving them to a new file so related functionality is in
the same file.

* Add repository

* Add NewRepository

* Close connection before cleanup of database

* Add comments to protobuf file and regenerate

* Define repository methods for HostCatalog

* Assign PublicId when resource is inserted into the database

* Wrap a nil parameter error

* Add oplog tickets for static host types

* WIP: first cut at CreateCatalog

* CreateHostCatalog: more tests

* Detect unique constraint violation

* Use const for PublicId prefixes

* Use PostgreSQL error name instead of error code

* Add TODO comments

* Fix comments

* Use PublicId not PublicID

* Refactor: move error variables from host/static to db

The error variables defined in host/static are generic and can be reused
by other packages.

* Create a new repository for each test

* Validate CreateCatalog returns a new HostCatalog

* Do not modify the HostCatalog passed in

* Implement UpdateCatalog

* Minor cleanup to make folds work

* Implement LookupCatalog

* Refactor: extract allocCatalog function

* Add comment

* Refactor: extract newCatalogMetadata function

* Make error strings more consistent

* Move database specific error check to internal/db package

* Change signature of DeleteCatalog and update docs

* Implement DeleteCatalog

* Make error strings more consistent

* Add examples

* Update docs

* Add package level doc and example for repository

* No need for using reflect.DeepEqual

* Remove redundant comment

* Clarify ErrMultipleRecords results in the transaction being rolled back

* Remove redundant error checks

* Remove unnecessary check

* Return early instead of using nested 'else' statements

* Update and Delete must return a row count

* catch err on defers (#82)

Co-authored-by: Jim Lambert <jimlambrt@Jims-MBP-3.home>

* Remove 'if assert' pattern

* Use assert package in test helper function

* Add test for updating a non existent catalog

* Use a single assert when a specific error is expected

* Use assert package when it clarifies the check

* Catch errors in cleanup functions

* Update comments in protobuf file

* Update doc for UpdateCatalog to reflect the new behavior

* Add common error values for field mask errors

* Require a field mask when calling update methods

* Add TODO for removing direct call to gorm

* Export Public ID prefixes

* Add db timestamp guards

* Remove unused option

Co-authored-by: Jim <jlambert@hashicorp.com>
Co-authored-by: Jim Lambert <jimlambrt@Jims-MBP-3.home>
2020-05-27 18:16:43 -04:00
Jeff Mitchell 9fd86faf15 Adds a dev target to Makefile and ports over build script (#75)
* Initial work on dev builds

* Fix build script
2020-05-21 16:03:21 -04:00
Todd Knight d08c26517b Makefile target to remove generated files (#63)
* Makefile rm's generated files before generating again and does operations relative to Makefile's path.
2020-05-19 08:33:19 -07:00
Jeff Mitchell 7f2aa5ca8f Add httpfs DB migrations and generate the input (#35) 2020-05-11 12:42:10 -04:00
Jim 8a5197e39e implement schema, store and repository for IAM scopes of organization and project 2020-05-08 11:36:28 -04:00
Jim 27b4d7a034 basic internal db interfaces and Gorm implementation
* db reader and writer interfaces which should allow us to encapsulate the vast majority of database code in this package.

* GormReadWriter implementation of the Reader and Writer interfaces
2020-05-05 13:29:47 -04:00