Commit Graph
1348 Commits
Author SHA1 Message Date
Timothy Messier 06ce257cb8 Merge branch 'tmessi/wh-refactors' 2021-08-30 15:45:09 -04:00
Timothy Messier 90e2c871f0 refactor(wh): Remove host prefix from wh_user_dimension org fields
These fields are being refactored so they conform with the new
wh_credential_dimension. This will inform Business Intelligence tools
that these attributes conform across dimensions.
2021-08-30 14:25:30 -04:00
Timothy Messier 026f09a9a8 refactor(wh): Rename primary and foreign key columns
The tables in the operational part of the Boundary database (meaning
non-warehouse tables) suffix primary key columns and foreign key columns
with `_id`. Many of these columns appear in the warehouse dimension and
fact tables as normal attributes, not primary keys or foreign keys. To
disambiguate ID columns from operational tables, the primary key column
for dimension tables will be renamed from `id` to `key` and the foreign
key columns in the fact tables will be renamed to change the suffix from
`_id` to `_key`.
2021-08-30 14:25:30 -04:00
Timothy Messier c8bf1917f5 db: Refactor test setup for pre-populated data
Now when initializing the test database for sql tests,
it will load the colors persona data into the database. This will
provide a data set that tests can use without needing to call
`wtt_load`.

The main motivation is to allow for a separation of setup and test
execution that requires crossing a transaction boundary. The pgTap tests
are required to exectue as a single transaction, so that the rollback
can reset the state, and each test can be isolated. However, can cause
issues with some test senarios, particuarly with the use of some times
releated functions like `current_timestamp` and `now` which return the
time that the current transaction started. This creates an issue if a
test relies on some setup that sets a time via `now`, then an update
that expects a new time via `now`.

See: https://www.postgresql.org/docs/13/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT
2021-08-30 14:25:30 -04:00
Pamela Bortnick 8e42b04b04 Update social share image (#1487)
* Update image for social share

* Remove Icon file
2021-08-26 11:12:31 -07:00
Jeff Mitchell 2649d1b966 Move protooptions to sdk/pbs (#1486)
This prevents a reverse dependency from sdk on the main module.
2021-08-26 11:04:32 -04:00
Jeff Mitchell b13975cb6a Move API resource pbs to new location (#1484)
This moves the generated pb files to the `sdk` module. This allows third parties to make use of them if desired (e.g. in upcoming plugins) and moves away from the `gen` nomenclature in the directory, since we are going to be adding some extra interface functions to the messages.
2021-08-26 10:44:41 -04:00
Mike Wickett 40b1e873f3 chore: update alert banner (#1452) 2021-08-23 13:36:53 -04:00
Zachary Shilton 6e435a8141 Upgrade global styles (#1418)
* website: bump packages for global style upgrades

* website: backfill missing type styles

* website: upgrade security page to use markdown-page

* website: upgrade g-container to g-grid-container

* website: upgrade community page

* website: hide alert-banner on mobile

* website: fix mismatched border colour on downloads page

* website: fix incorrect className

* website: bump to fix issue with typography on OpenAPI pages
2021-08-20 12:19:48 -04:00
Jeff Mitchell 7aba3b16a4 Add WIP KMS plugin assets to .gitignore 2021-08-20 08:50:49 -04:00
Todd Knight 1cacd8ee35 Update website VERSION export to 0.5.1 2021-08-19 10:31:01 -07:00
Michael Gaffney 5f88243ddc Fix db migration that adds support for OIDC in the data warehouse (#1471)
Four new columns were added to the `wh_user_dimension` table to support
OIDC. The data type for the columns was originally `wh_dim_text` which
is a domain type with a `not null` restriction. Adding the new columns
caused the migration to fail if the `wh_user_dimension` table had any
rows in it because the existing rows would violate the `not null`
restriction.

Closes #1469
2021-08-18 22:18:51 -04:00
Jeff Mitchell b0dbd0182e Add support for additional awskms parameters (#1468)
This updates to the latest go-kms-wrapping tag to support these
parameters and documents them.
2021-08-18 12:45:20 -04:00
Louis RuchandJeff Mitchell 31af49e76d refactor(worker): Move tcp_proxy into its own package (#1458)
* refactor(worker): Move tcp_proxy into its own package

This refactors:

- the tcp_proxy.go into worker/proxy/tcp
- add a missing unit test for the HandleTcpProxyV1
- refactors session.go into worker/session, needed to avoid import cycle
- adds a baseline for a mock controller session client
- go lint fixes

* Add sleep between spinning listener goroutine and dialing

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2021-08-18 15:30:55 +02:00
Todd Knight c79daab68c Update to version 0.5.1 2021-08-16 13:11:30 -07:00
Jeff Mitchell 2fe9fd60f2 Bump Go to 1.16.7 (#1464) 2021-08-16 10:57:47 -07:00
Michael Gaffney ef051135b2 Add data warehouse changes for OIDC to the Changelog (#1465) 2021-08-16 13:21:40 -04:00
Jim 4d70c049c2 fix: Stop trying to re-write the resp header on event flush errors (#1463) 2021-08-16 11:52:28 -04:00
Timothy Messier 0f19009cea feat(wh): Add oidc related columns to wh_user_dimension (#1455)
This adds new columns to the wh_user_dimension to provide additional
data from OIDC that does not apply to Password Auth.

Note: Given the specifics of the data, it is possible these columns may
be used by other auth methods in the future, hence the lack of `oidc` in
the column names.

The specific columns are:

- auth_method_external_id
    For OIDC this is the Issuer
- auth_account_external_id
    For OIDC this is the Subject
- auth_account_full_name
    For OIDC this is the account's Full Name, and can be `None`.
- auth_account_email
    For OIDC this is the account's Email, and can be `None`.

For all of these new columns, they will be `Not Applicable` if the auth
method is Password.
2021-08-11 18:45:14 -04:00
Jeff Mitchell f7894811f5 Update go-bexpr to allow colons in paths; add a test (#1453) 2021-08-11 15:27:56 -04:00
Jim 3bd6a209a4 prevent panic when hclog_formatter_node is operating on a struct (#1456) 2021-08-11 15:24:48 -04:00
Timothy Messier 624bdbf0c2 test(db): Add baseline tests for wh_user_dimension (#1454)
This sets up the configuration for running a new suite of tests that are
written in sql, to test the sql logic implemented in plpgsql functions
and triggers. It is primarily designed to provides tests for the data
warehouse functionality that is implemented purely in sql.

The infrastructure to run these tests leverages docker. It creates one
docker container using the `library/postgres` image and provisions the
database with the boundary sql migrations and test helper functions.  A
separate docker container is run that has the pgtap extension and
pg_prove cli to execute the tests.

As noted, pgtap is used for the tests. This postgresql extension
provides a number of helpful assertion functions to make writing sql
tests easier. It also, along with the pg_prove cli, provides readable
test output.

Along with the new testing infrastructure this commit establishes a
baseline of tests for the wh_user_dimension:

- Unit tests for individual views and functions:
    - whx_user_dimension_source
    - whx_user_dimension_target
    - wh_upsert_user
- Integration tests for that verify that the wh_user_dimension gets
  populated correctly when sessions are inserted or updated. This
  ensures that:
    - the trigger runs on session insert
    - the trigger results in the correct changes to the
      wh_user_dimension.

This commit provides a `Makefile` to run the tests locally that provides
support for:

- Setting the postgres docker image to easily test multiple versions.
- Passing through options to pg_prove
- Passing the test list to run individual tests
- Additional targets to separately startup the database image to quickly
  re-run tests while developing new tests.

Lastly configures circleci to run this test suite as a matrix build
in parallel with the other tests. The matrix build tests multiple
versions of postgres:

- latest
- 13-alpine
- 12-alpine
- 11-alpine

See:
    https://pgtap.org/
2021-08-11 13:25:32 -04:00
Taylor Dolezal 248e1f36b5 Update next steps in connect to target documentation (#1439) 2021-08-09 08:12:31 -07:00
Susmitha Girumala ba85a3bc3f docs: Update desktop client download version (#1450) 2021-08-05 21:10:43 -04:00
Jim b3d8b50307 Sink documentation (#1449) 2021-08-05 19:31:02 -04:00
Mike Wickett 534efef039 rebase cleanup (#1435) 2021-08-05 13:31:01 -07:00
Jim 477b541bf0 Events: ongoing clean up of eventing (#1448) 2021-08-05 10:54:10 -04:00
Jim 00cb18efbe use parseutil.ParseDurationSecond(...) which allows a value without a suffix to be treated as seconds instead of nanoseconds (#1447) 2021-08-04 19:11:00 -04:00
Jim acc3dda2df parse the duration string specified in an event file config into a time.Duration (#1446) 2021-08-04 17:57:36 -04:00
Todd Knight 8496093874 make fmt. 2021-08-04 13:56:54 -07:00
Jeff MitchellandJim c75c97a872 Normalize event configuration (#1444)
* Normalize event configuration

This updates event configuration stanzas to more closely match behavior
for listeners and kmses:

* Singular "sink" instead of "sinks" (probably not the most correct
  option, but a consistent option, and one that makes sense for HCL)
* Allows sinks to have the type defined at the start of the block
* Moves type-specific configuration to a specific named block

Co-authored-by: Jim <jlambert@hashicorp.com>
2021-08-04 14:01:58 -04:00
s-christoff 00ada3c578 update op (#1442) 2021-08-03 17:56:18 -06:00
Jim 3a3f956615 support new event formats of: hclog-text and hclog-json (#1440) 2021-08-03 15:06:19 -04:00
Jeff Mitchell e3012afb4f Add primary auth method ID to default output fields, fix display bug (#1441) 2021-08-03 14:16:02 -04:00
Todd Knight 6b578c0e30 Update to versions 0.5.0 2021-08-02 13:36:07 -07:00
Todd Knight 39cc245966 Make gen after make tools. Includes make fmt of existing non generated files. (#1438) 2021-08-02 10:46:09 -07:00
Todd Knight 03b4c095c4 Fix syntax error in profiling_on.go (#1437) 2021-08-02 09:58:58 -07:00
Chris MarchesiandJeff Mitchell 947dc96b30 server: Add back controller shutdown on worker startup failure (#1432)
* server: Add back controller shutdown on worker startup failure

This adds back the controller shutdown call on worker failure.

This was added in a15961e4 to address a panic discovered in testing, and
was mistakenly thought to be unnecessary. This, however, covers
multi-role scenarios where we have already started the controller, which
needs to be shut down gracefully if possible if we can't start the
worker.

A nil check has been added to ensure the panic does not resurface.

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2021-08-02 12:35:57 -04:00
Bryce Kalow 8599b55f7a web: migrate to web platform- packages (#1405)
* migrate usages of nextjs-scripts to platform packages

* upgrade hashi packages

* use new downloads page component

* adds missing dep

* remove redundant head component

* remove styles

* remove unused prop
2021-08-02 12:34:03 -04:00
Jim 6785055a4d update to latest tagged version (#1436) 2021-08-02 09:01:46 -04:00
Jim 137729b0c0 Event log adpaters (#1434) 2021-08-02 07:47:17 -04:00
Jim 68dd2a66ba Remove unneeded hclog dependencies as we move forward with events (#1433) 2021-08-01 14:41:13 -04:00
Jim df42c71881 add events feature to changelog (#1431) 2021-07-30 15:20:18 -04:00
Chris MarchesiandJim 29ea10c6f8 Add session cleanup changes to CHANGELOG.md (#1426)
* Add session cleanup changes to CHANGELOG.md

* Shorten controller-side connection cleanup entry

* Update CHANGELOG.md

Co-authored-by: Jim <jlambert@hashicorp.com>

Co-authored-by: Jim <jlambert@hashicorp.com>
2021-07-30 08:55:01 -07:00
Jeff Mitchell f8a51b987c Migrate target host sets -> host sources (#1424)
This follows the same model as https://github.com/hashicorp/boundary/pull/1413

See there and CHANGELOG for more details.
2021-07-30 08:48:03 -04:00
s-christoffandJim 6b78108ecf Update primary error functions to take a context, deprecate old functions (#1358)
* add new error funcs which take a ctx and deprecate existing funcs

* use context where available when writing error events

* remove circular internal/errors pkg dep

* suppress some chatty errors using errors.WithoutEvent()

* convert auth oidc funcs to take context where needed to write events

Co-authored-by: Jim <jlambert@hashicorp.com>
2021-07-29 20:52:56 -04:00
Randall Morey 02ff2db66e docs: add credential doc redirects and fix session redirect (#1425)
* docs:  add credential doc redirects and fix session redirect

* fix: source -> library
2021-07-29 19:28:02 -04:00
Susmitha Girumala 868a165a86 Bump admin UI version for credential brokering feature (#1429) 2021-07-29 19:01:36 -04:00
Chris Marchesi bf679c2f05 Fix Makefile target (docker-multiarch-build) (#1427) 2021-07-29 11:00:03 -04:00
Louis Ruch 76a7ce93e8 Fix race with base context cancel and final run update in scheduler (#1422)
* Fix race with base contedt cancel and final run update

* Use scheduler waitgroup to wait for all running jobs to exit:
2021-07-28 23:48:11 +02:00