Commit Graph
161 Commits
Author SHA1 Message Date
Louis Ruch ec0020de90 Refactor host_repo -> domain errors (#786)
* Refactor domain errors: New -> E, create helper New and Wrap
* Update host repo to use domain errors
2020-12-09 10:11:38 -08:00
Todd Knight f6e50006fc Generate postgres.gen.go using schema version directory structure (#808)
* Reorganize the db migration .sql scripts into individual schema version directories and generate the sql httpfs fakeFile accordingly.

* Created a /dev schema version directory to hold db schema updates that have not been finalized.

* Add an 'allow-development-migrations' flag to allow `boundary database init` to be executed even when there are schema updates in /dev.
2020-12-04 21:32:27 -07:00
Jim af6ef1b687 Refactor existing sentinel errors (#774) 2020-11-05 16:54:03 -05:00
Jeff Mitchell 813d21565f Allow authorize-session to be invoked with target name (#737) 2020-10-22 08:40:00 -04:00
Jim 547ae7c802 Fix database init when locale isn't english (#736)
* use IsMissingTableError(error)

* update changelog
2020-10-20 21:13:01 -04:00
Jim dc379ed09f handle unlimited connections when terminating sessions. (#536) 2020-10-05 17:01:22 -04:00
Jim 09b43e5569 deprecate/remove LookupByName (#530) 2020-10-05 12:45:27 -04:00
Jim bd547fd0d6 terminate a canceled session when its last connection is closed. (#520) 2020-10-02 10:01:46 -04:00
Jeff Mitchell fa700dc002 Add account ID templating (#518)
* Remove default role and create via the same mechanism as other initial resources
2020-10-01 10:51:54 -04:00
Jim 19aecfefae terminate "completed" sessions (#477) 2020-10-01 10:13:57 -04:00
Jeff Mitchell 6ddfe407a3 Update allowed formats of ACL strings (#508) 2020-10-01 01:49:20 -04:00
Jim 1e71c55920 deprecate access to underlying *sql.DB via internal/db.DB() (#506) 2020-09-30 18:11:59 -04:00
Michael Gaffney a9e806b673 Data warehouse (#475)
* Define initial warehouse schema

* Add session id as the primary key to the session accumulating fact table

* Insert a row to use instead of nulls in the time and date dimensions

* Add missing attributes and a partial index

* Rename files

* Refactor: move fact table to a separate migration

* Add domain types for the warehouse

* Add session connection transaction fact table

* Change columns to match ingress data types

* Add views for host dimension ingress

* Create source and target views for the host and user dimensions

* Generate random ID for dimension table primary key

* Formatting changes

* Add current dimension id to target views

* Implement upsert function for host dimension

* Use domain types for upsert function parameters

* Fix indentation

* Add wh_public_id domain type

* Fix value of type columns when the other columns are null

* Implement upsert function for user dimension

* Add warehouse domain types for timestamps and text fields

* Move fact table migrations to a higher number

* Add functions for getting the current date and current time IDs

* Rename backend to endpoint in column names

* Rename fact tables

The fact tables are actually accumulating fact tables not transactional
fact tables.

* Add default value to connection_authorized_time column

* Update session fact table

* Add session_max_seconds, session_connection_limit, and default_port to wh_host_dimension

* Move session table above connection table

* Add after insert trigger to session table for warehouse ingress

* Add fk from connection warehouse table to session warehouse table

* Implement insert trigger for session connections

* Update warehouse for a user having multiple auth accounts

* Rename warehouse columns to be consistent with operational tables

* Add connection specific columns to the connection fact table

* Update session calculations in warehouse

* Rename functions and formatting changes

* Rename session columns to match names of session states

* Implement warehouse triggers for session and connection state changes

* Run 'make migrations'

* Use a static start and end date for the warehouse date dimension

* Document warehouse functions

* Remove outdated TODO comments

* Add TODO comments for additional dimensions and fact table columns
2020-09-30 14:09:40 -04:00
Jeff Mitchell cefea936c3 Update ACLs to allow type=*. (#504) 2020-09-29 22:55:22 -04:00
Jeff Mitchell a38f40606e Create default roles in scopes to allow authentication and listing scopes/auth methods (#502) 2020-09-29 20:38:16 -04:00
Jeff Mitchell c1a1f8bb1b Separate out docker dep into package (#482)
This also then removes support for docker-based containing starting (for
now) from platforms other than windows/darwin/linux as there are build
issues on several.
2020-09-28 16:05:15 -04:00
Jeff Mitchell bec3d702fb Add -database-url to dev mode (#459)
Create default dev mode login name of "admin" and password of "password"
2020-09-25 17:36:47 -04:00
Jim 978f7dc34c fix immutable columns for session_state and session_connnection_state (#449) 2020-09-25 16:04:43 -04:00
Jim 21ca0b6388 SetAssociatedAccounts, DisassociateAccounts, AssociateAccounts with support for multiple accounts. (#439) 2020-09-25 13:35:32 -04:00
Michael Gaffney 36d465476c Name all the check constraints in the database (#410)
* Name all of the check constraints

* Run 'make migrations'
2020-09-22 14:44:21 -04:00
Jim 57da9f918e cancel a session when one of its FKs is set to null (#406) 2020-09-22 14:36:20 -04:00
Michael Gaffney f0c84de49c Disambiguate auth_account scope_id by adding iam_user_scope_id column (#407) 2020-09-22 13:30:11 -04:00
Jeff Mitchell dd06615c2e Add database initialization command (#400) 2020-09-21 20:25:16 -04:00
Jeff Mitchell 7e3c174b70 Disallow deletion of r_default (#398)
If it's a useful named resource and people accidentally delete it e.g.
with TF, they can't get it back. This doesn't affect TF's ability to
manage it, just delete.
2020-09-21 16:50:39 -04:00
Jeff Mitchell f25186f78a Standardize on one spelling of "canceled" (#399) 2020-09-21 16:33:28 -04:00
Michael Gaffney d52fb81e68 Change the default max session for a target to 8 hours (#392)
* Change the default max session for a target to 8 hours

* Run 'make migrations'
2020-09-21 12:12:18 -04:00
Jeff Mitchell 7db0e2a5ed Fix database check 2020-09-20 16:09:11 -04:00
Jim 5764b2c70a return States as a field of Connection repo operations. (#382) 2020-09-20 15:54:39 -04:00
Jeff Mitchell edffc7863d Change connection limit to -1 for unlimited so it works with TF (#383)
* Migrate connection limit unlimited value to -1

* Fix authorization check
2020-09-20 15:53:49 -04:00
Jim 66400c9cff changes needed for sessions.AuthorizeConnection (#377) 2020-09-19 14:21:09 -04:00
Jeff Mitchell 5bf555cca2 Remove connection idle timeout seconds for now (#379) 2020-09-19 14:01:49 -04:00
Jeff Mitchell 0a3f9b8357 Rename connection idle timeout duration -> seconds and sessions max duration -> seconds (#376) 2020-09-19 11:32:38 -04:00
Jeff MitchellandJim Lambert 62baef1b7e Add multi connection parameters through targets and into session creation (#375)
* Update protos and gen

* Add new values to targets CLI command

* Lots more plumbing of new parameters through everything

* allow fields to be set to zero value.

* Disallow set but empty name/description strings in create/update verifiers

Co-authored-by: Jim Lambert <jlambert@hashicorp.com>
2020-09-19 10:31:49 -04:00
Jeff Mitchell 07a7e9750a Tie together the database-driven session handling with the worker and add relevant CLI comands (#370) 2020-09-19 00:18:17 -04:00
Jim e7e70b1b94 new domain functions for the session repo (#368) 2020-09-18 18:12:41 -04:00
Jim 7e927203e8 schema changes to support multi-connections (#372) 2020-09-18 17:41:45 -04:00
Jeff Mitchell 8bef1d734a Fix mismatch in default role creation permissions 2020-09-16 12:56:41 -04:00
Jim 611288bdc7 basic sessions (#337) 2020-09-16 12:02:02 -04:00
Jeff Mitchell c4e2b88022 Add database URL. (#365)
* Add database URL.

This allows specification of either a file://, env://, or other string.
If it starts with file:// or env:// the actual value will be read from
those resources.

* Tidy up the KMS output

* Also run migrations in test mode when specifying the URL
2020-09-16 09:28:39 -04:00
Jeff Mitchell 4ef0c57a39 Fix r_default description typo 2020-09-16 08:53:36 -04:00
Todd Knight b998591add Adding and updating host address validation checks (#350) 2020-09-12 22:07:56 -07:00
Michael Gaffney 4ae3a52056 Define session database schema (#322)
* Define session database schema

* Update comments

* Add insert trigger for session state

* Add canceling state and update foreign keys to 'set null' on delete
2020-09-03 10:49:27 -04:00
Jim f29869b715 support for additional deks: oplog, session and token and new CreateKeysTx() (#321) 2020-09-02 14:37:19 -04:00
Jeff Mitchell ee35a92f7f Fix space issue in protobuf that apparently doesn't matter? Also apparently postgres migrations weren't run. 2020-09-02 13:38:07 -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
Michael Gaffney 58dec98ea2 Rename table from servers to server (#307) 2020-08-26 13:15:12 -04:00
Michael Gaffney de162c5533 Replace and remove ErrNilParameter with ErrInvalidParameter (#295) 2020-08-25 12:18:14 -04:00
Jeff Mitchell ac4d9fa311 Add nonce storage and replay prevention test (#293) 2020-08-24 13:22:10 -04:00
Jeff Mitchell b47cca0329 Add (non-db aspects of) the recovery key workflow (#286) 2020-08-20 13:34:03 -04:00