Commit Graph
69 Commits
Author SHA1 Message Date
Michael Gaffney 0af36d3d8a refactor(sql): Consolidate changes to oplog_entry into one migration 2023-09-06 20:05:50 -04:00
Michael Gaffney 3befccffd7 refactor(sql): Reorder and rename oplog kms migrations 2023-09-06 19:55:33 -04:00
Michael Gaffney d8393e5793 style(sql): fix indenting and remove trailing whitespace 2023-09-06 19:11:05 -04:00
Michael Gaffney f98167fd2a doc(changelog): Add 0.13 release 2023-06-13 00:53:40 -07:00
Michael Gaffney fda1a0b572 doc(changelog): Add LDAP auth method 2023-06-12 17:53:39 -04:00
Michael Gaffney 531f7cf449 changelog: reorder sections 2023-06-12 17:01:03 -04:00
Michael Gaffney 3a9439a4e9 docs: Fix markdown in SQL style guide 2023-06-05 15:30:43 -04:00
Michael Gaffney 99a8777866 fix(db): Add index to session connection table
This index improves the performance for two queries on the
`session_connection` table. The execution time for the first query went
from 40.105 ms to 1.405 ms. The execution time for the second query went
from 13.808 ms to 0.217 ms.

Query 1 explain plan before index:

    Update on session_connection  (cost=6465.17..6557.68 rows=11 width=50) (actual time=38.868..39.147 rows=3 loops=1)
      ->  Nested Loop  (cost=6465.17..6557.68 rows=11 width=50) (actual time=38.471..38.506 rows=3 loops=1)
            ->  HashAggregate  (cost=6464.75..6464.86 rows=11 width=40) (actual time=38.447..38.450 rows=3 loops=1)
                  Group Key: (session_connection_1.public_id)::text
                  Batches: 1  Memory Usage: 24kB
                  ->  Nested Loop Semi Join  (cost=0.42..6464.72 rows=11 width=40) (actual time=29.184..38.434 rows=3 loops=1)
                        ->  Seq Scan on session_connection session_connection_1  (cost=0.00..6329.38 rows=16 width=20) (actual time=15.744..38.014 rows=23 loops=1)
                              Filter: ((worker_id)::text = 'w__________k'::text)
                              Rows Removed by Filter: 163607
                        ->  Index Scan using session_connection_state_connection_id_end_time_key on session_connection_state  (cost=0.42..8.45 rows=1 width=20) (actual time=0.016..0.016 rows=0 loops=23)
                              Index Cond: (((connection_id)::text = (session_connection_1.public_id)::text) AND (end_time IS NULL))
                              Filter: ((state = ANY ('{authorized,connected}'::text[])) AND (start_time < (CURRENT_TIMESTAMP - '00:00:05'::interval)))
                              Rows Removed by Filter: 1
            ->  Index Scan using session_connection_pkey on session_connection  (cost=0.42..8.44 rows=1 width=20) (actual time=0.016..0.016 rows=1 loops=3)
                  Index Cond: ((public_id)::text = (session_connection_1.public_id)::text)
    Planning Time: 0.793 ms
    Trigger immutable_columns: time=0.474 calls=3
    Trigger update_connection_state_on_closed_reason: time=0.159 calls=3
    Trigger update_time_column: time=0.034 calls=3
    Trigger update_version_column: time=0.041 calls=3
    Trigger wh_update_session_connection: time=0.688 calls=3
    Execution Time: 40.105 ms

Query 1 explain plan after index:

    Update on session_connection  (cost=152.71..219.87 rows=8 width=50) (actual time=0.497..0.683 rows=3 loops=1)
      ->  Nested Loop  (cost=152.71..219.87 rows=8 width=50) (actual time=0.266..0.292 rows=3 loops=1)
            ->  HashAggregate  (cost=152.29..152.37 rows=8 width=40) (actual time=0.256..0.258 rows=3 loops=1)
                  Group Key: (session_connection_1.public_id)::text
                  Batches: 1  Memory Usage: 24kB
                  ->  Nested Loop Semi Join  (cost=4.94..152.27 rows=8 width=40) (actual time=0.199..0.251 rows=3 loops=1)
                        ->  Bitmap Heap Scan on session_connection session_connection_1  (cost=4.51..50.76 rows=12 width=20) (actual time=0.017..0.035 rows=10 loops=1)
                              Recheck Cond: ((worker_id)::text = 'w__________k'::text)
                              Heap Blocks: exact=9
                              ->  Bitmap Index Scan on session_connection_worker_id_closed_reason_ix  (cost=0.00..4.51 rows=12 width=0) (actual time=0.011..0.011 rows=10 loops=1)
                                    Index Cond: ((worker_id)::text = 'w__________k'::text)
                        ->  Index Scan using session_connection_state_connection_id_end_time_key on session_connection_state  (cost=0.42..8.45 rows=1 width=20) (actual time=0.021..0.021 rows=0 loops=10)
                              Index Cond: (((connection_id)::text = (session_connection_1.public_id)::text) AND (end_time IS NULL))
                              Filter: ((state = ANY ('{authorized,connected}'::text[])) AND (start_time < (CURRENT_TIMESTAMP - '00:00:05'::interval)))
                              Rows Removed by Filter: 1
            ->  Index Scan using session_connection_pkey on session_connection  (cost=0.42..8.44 rows=1 width=20) (actual time=0.010..0.010 rows=1 loops=3)
                  Index Cond: ((public_id)::text = (session_connection_1.public_id)::text)
    Planning Time: 0.614 ms
    Trigger immutable_columns: time=0.279 calls=3
    Trigger update_connection_state_on_closed_reason: time=0.185 calls=3
    Trigger update_time_column: time=0.027 calls=3
    Trigger update_version_column: time=0.032 calls=3
    Trigger wh_update_session_connection: time=0.450 calls=3
    Execution Time: 1.405 ms

Query 2 explain plan before index:

    Limit  (cost=1002.40..6147.94 rows=1 width=253) (actual time=12.244..13.726 rows=1 loops=1)
      ->  Nested Loop Left Join  (cost=1002.40..6147.93 rows=1 width=253) (actual time=12.243..13.724 rows=1 loops=1)
            Join Filter: ((w.public_id)::text = (session_connection.worker_id)::text)
            CTE worker_config_tags
              ->  GroupAggregate  (cost=1.71..2.26 rows=22 width=59) (actual time=0.044..0.082 rows=22 loops=1)
                    Group Key: ct_1.worker_id, ct_1.source
                    ->  Sort  (cost=1.71..1.77 rows=22 width=49) (actual time=0.031..0.034 rows=22 loops=1)
                          Sort Key: ct_1.worker_id, ct_1.source
                          Sort Method: quicksort  Memory: 27kB
                          ->  Seq Scan on server_worker_tag ct_1  (cost=0.00..1.22 rows=22 width=49) (actual time=0.007..0.010 rows=22 loops=1)
            ->  Nested Loop Left Join  (cost=0.14..9.28 rows=1 width=245) (actual time=0.106..0.108 rows=1 loops=1)
                  Join Filter: ((w.public_id)::text = (ct.worker_id)::text)
                  ->  Nested Loop Left Join  (cost=0.14..8.72 rows=1 width=213) (actual time=0.103..0.104 rows=1 loops=1)
                        Join Filter: ((w.public_id)::text = (wt.worker_id)::text)
                        ->  Index Scan using server_worker_pkey on server_worker w  (cost=0.14..8.15 rows=1 width=181) (actual time=0.012..0.012 rows=1 loops=1)
                              Index Cond: ((public_id)::text = 'w__________k'::text)
                        ->  CTE Scan on worker_config_tags wt  (cost=0.00..0.55 rows=1 width=64) (actual time=0.090..0.090 rows=0 loops=1)
                              Filter: (((worker_id)::text = 'w__________k'::text) AND (source = 'api'::text))
                              Rows Removed by Filter: 22
                  ->  CTE Scan on worker_config_tags ct  (cost=0.00..0.55 rows=1 width=64) (actual time=0.001..0.002 rows=1 loops=1)
                        Filter: (((worker_id)::text = 'w__________k'::text) AND (source = 'configuration'::text))
                        Rows Removed by Filter: 8
            ->  GroupAggregate  (cost=1000.00..6136.36 rows=1 width=21) (actual time=12.133..13.610 rows=0 loops=1)
                  Group Key: session_connection.worker_id
                  ->  Gather  (cost=1000.00..6136.35 rows=1 width=13) (actual time=12.132..13.608 rows=0 loops=1)
                        Workers Planned: 2
                        Workers Launched: 2
                        ->  Parallel Seq Scan on session_connection  (cost=0.00..5136.25 rows=1 width=13) (actual time=9.012..9.012 rows=0 loops=3)
                              Filter: ((closed_reason IS NULL) AND ((worker_id)::text = 'w__________k'::text))
                              Rows Removed by Filter: 54544
    Planning Time: 0.398 ms
    Execution Time: 13.808 ms

Query 2 explain plan after index:

    Limit  (cost=2.82..20.03 rows=1 width=253) (actual time=0.132..0.134 rows=1 loops=1)
      ->  Nested Loop Left Join  (cost=2.82..20.02 rows=1 width=253) (actual time=0.131..0.133 rows=1 loops=1)
            Join Filter: ((w.public_id)::text = (session_connection.worker_id)::text)
            CTE worker_config_tags
              ->  GroupAggregate  (cost=1.71..2.26 rows=22 width=59) (actual time=0.046..0.086 rows=22 loops=1)
                    Group Key: ct_1.worker_id, ct_1.source
                    ->  Sort  (cost=1.71..1.77 rows=22 width=49) (actual time=0.033..0.035 rows=22 loops=1)
                          Sort Key: ct_1.worker_id, ct_1.source
                          Sort Method: quicksort  Memory: 27kB
                          ->  Seq Scan on server_worker_tag ct_1  (cost=0.00..1.22 rows=22 width=49) (actual time=0.007..0.011 rows=22 loops=1)
            ->  Nested Loop Left Join  (cost=0.14..9.28 rows=1 width=245) (actual time=0.120..0.120 rows=1 loops=1)
                  Join Filter: ((w.public_id)::text = (ct.worker_id)::text)
                  ->  Nested Loop Left Join  (cost=0.14..8.72 rows=1 width=213) (actual time=0.117..0.118 rows=1 loops=1)
                        Join Filter: ((w.public_id)::text = (wt.worker_id)::text)
                        ->  Index Scan using server_worker_pkey on server_worker w  (cost=0.14..8.15 rows=1 width=181) (actual time=0.011..0.012 rows=1 loops=1)
                              Index Cond: ((public_id)::text = 'w__________k'::text)
                        ->  CTE Scan on worker_config_tags wt  (cost=0.00..0.55 rows=1 width=64) (actual time=0.104..0.105 rows=0 loops=1)
                              Filter: (((worker_id)::text = 'w__________k'::text) AND (source = 'api'::text))
                              Rows Removed by Filter: 22
                  ->  CTE Scan on worker_config_tags ct  (cost=0.00..0.55 rows=1 width=64) (actual time=0.002..0.002 rows=1 loops=1)
                        Filter: (((worker_id)::text = 'w__________k'::text) AND (source = 'configuration'::text))
                        Rows Removed by Filter: 8
            ->  GroupAggregate  (cost=0.42..8.45 rows=1 width=21) (actual time=0.010..0.010 rows=0 loops=1)
                  Group Key: session_connection.worker_id
                  ->  Index Only Scan using session_connection_worker_id_closed_reason_ix on session_connection  (cost=0.42..8.44 rows=1 width=13) (actual time=0.010..0.010 rows=0 loops=1)
                        Index Cond: ((worker_id = 'w__________k'::text) AND (closed_reason IS NULL))
                        Heap Fetches: 0
    Planning Time: 0.544 ms
    Execution Time: 0.217 ms

Closes #3281
2023-06-05 15:22:41 -04:00
Michael Gaffney 8159ddb08e feat(db): Add function to update billing snapshot table
This adds the `update_sessions_pending_daily_snapshot` SQL function
which updates the `sessions_pending_daily_snapshot` table by inserting
values for any days missing from the table.

This also adds a check constraint to the
`sessions_pending_daily_snapshot` table along with a `comment on table`.

This also removes the hcp daily billing views since they are no longer
needed.

Ref: ace2def49d
2023-06-05 12:48:15 -04:00
Michael Gaffney 41bdfb4406 fix(db): Fix time zone consistency issues in monthly billing views
The hcp monthly billing views build a range of buckets using the
`generate_series` and the `now()` functions along with relative offsets
like `+ 1 month`. The calculated start and end times for these views can
vary depending on the time zone setting of the PostgreSQL server.

This adds 3 table functions that call their respective views with the
time zone set to UTC. Calling these functions instead of their
underlying views directly prevents the returned values from varying when
the server's time zone is not set to UTC.

This also drops support for PostgreSQL 11. The included tests use the
`date_trunc(field, source [, time_zone ])` function added in PostgreSQL
12.

Fixes: 41b1b5b4b7
2023-06-05 12:48:15 -04:00
Michael Gaffney 47ddd2e40a fix(db): Fix generated series to yield consistent results
The hcp billing `_all` views built a range of buckets using the
`generate_series` function using the minimum value of the
`session_pending_time` column from the `wh_session_accumulating_fact`
table as the start time and `now()` as the end time. It then truncated
values in the series using the `date_trunc` function. This allowed the
generated series of buckets returned to vary and could result in one
additional bucket being included in the series depending on the current
time and the start time.

As an illustrative example, the `hourly_all` query used:

    select date_trunc('hour',time)
      from generate_series(
             (select min(session_pending_time) -- start time
                from wh_session_accumulating_fact),
              now(),
              '1 hour'::interval
           ) as time;

Substituting the start time with a hard coded value to show the issue:

    -- Show current time, where the minutes portion is 55
    select now();
                  now
    -------------------------------
     2023-05-22 14:55:40.567605+00
    (1 row)

    -- generate series with start time's minutes portion at 57
    select date_trunc('hour',time)
      from generate_series(
              '2023-05-22 01:57:00'::timestamptz,
              now(),
              '1 hour'::interval
           ) as time;

           date_trunc
    ------------------------
     2023-05-22 01:00:00+00
     2023-05-22 02:00:00+00
     2023-05-22 03:00:00+00
     2023-05-22 04:00:00+00
     2023-05-22 05:00:00+00
     2023-05-22 06:00:00+00
     2023-05-22 07:00:00+00
     2023-05-22 08:00:00+00
     2023-05-22 09:00:00+00
     2023-05-22 10:00:00+00
     2023-05-22 11:00:00+00
     2023-05-22 12:00:00+00
     2023-05-22 13:00:00+00
    (13 rows)

    -- Wait a few minutes
    select now();
                 now
    ------------------------------
     2023-05-22 14:58:48.75287+00
    (1 row)

    -- Now run again and get an extra result, even though still
    -- within the same hour
    select date_trunc('hour',time)
      from generate_series(
              '2023-05-22 01:57:00'::timestamptz,
              now(),
              '1 hour'::interval
           ) as time;

           date_trunc
    ------------------------
     2023-05-22 01:00:00+00
     2023-05-22 02:00:00+00
     2023-05-22 03:00:00+00
     2023-05-22 04:00:00+00
     2023-05-22 05:00:00+00
     2023-05-22 06:00:00+00
     2023-05-22 07:00:00+00
     2023-05-22 08:00:00+00
     2023-05-22 09:00:00+00
     2023-05-22 10:00:00+00
     2023-05-22 11:00:00+00
     2023-05-22 12:00:00+00
     2023-05-22 13:00:00+00
     2023-05-22 14:00:00+00
    (14 rows)

To fix this, we call the `generate_series` function truncating the start
time argument to the bucket size:

    -- Hourly
    select bucket
      from generate_series(
              date_trunc('hour', select min(session_pending_time)
                                   from wh_session_accumulating_fact)),
              now(),
              '1 hour'::interval
           ) as bucket;

    -- Monthly
    select bucket
      from generate_series(
              date_trunc('month', select min(session_pending_time)
                                    from wh_session_accumulating_fact)),
              now(),
              '1 month'::interval
           ) as bucket;

Fixes: 41b1b5b4b7
2023-06-05 12:48:15 -04:00
Michael Gaffney 053e74f66c feat(db): Add table for census upload job status 2023-06-05 11:32:26 -04:00
Michael Gaffney 8bf80e0544 test(db): Conditionally skip monthly billing view tests
Certain tests fail when run on the first day of the month because of
edge cases in the setup of test data. This adds conditional logic to
skip those tests when run on the first day of a month.
2023-06-04 09:31:40 -04:00
Michael Gaffney a783c91b2d feat(sql): Add dynamic credential hst tables to session recording
This adds the `recording_dynamic_credential` join table and a trigger
that runs as an after insert on the `recording_session` table. The join
table joins the `recording_session`, `credential_vault_store_hst`,
`credential_library_history_base`, and the `credential_purpose_enm`
tables.
2023-05-31 12:18:19 +00:00
Michael Gaffney 3769f0851c test(sql): Refactor the colors persona
This changes multiple IDs in the colors persona to be 12 characters. It
also renames some IDs in an attempt to make them more consistent. This
also changes the order of the columns in some insert statements to
follow the pattern of the other insert statements.

This also adds documentation to the top of colors persona file in an
attempt to explain the general patterns being followed in the file.
2023-05-31 12:18:19 +00:00
Michael Gaffney 03b1291b34 feat(sql): Add history tables for dynamic credentials
This adds history tables for `credential_vault_store`,
`credential_vault_library`, and `credential_vault_ssh_cert_library`.
This also adds a base table for the credential library history tables.
2023-05-31 12:18:19 +00:00
Michael Gaffney a8224f4f57 feat(sql): Add endpoint from session table to session recording
This adds an `endpoint` column to the `recording_session` table and
updates the session recording insert trigger to copy the value of
`endpoint` from the `session` table to the `recording_session` table.
2023-05-31 12:18:18 +00:00
Michael Gaffney 06e4e46248 feat(sql): Add static credential hst tables to session recording
This adds the `recording_static_credential` join table and a trigger
that runs as an after insert on the `recording_session` table. The join
table joins the `recording_session`, `credential_static_store_hst`,
`credential_static_history_base`, and the `credential_purpose_enm`
tables.
2023-05-31 12:18:18 +00:00
Michael Gaffney 3a64fb3d58 feat(sql): Add history tables for static credentials
This adds history tables for `credential_static_store`,
`credential_static_json_credential`,
`credential_static_username_password_credential`, and
`credential_static_ssh_private_key_credential`. This also adds a base
table for the static credential history tables.
2023-05-31 12:18:18 +00:00
Michael Gaffney 477e6df269 feat(sql): Add target and host history tables to session recording
This adds four columns to the `recording_session` table which are
foreign keys to the `iam_scope_hst`, `target_ssh_hst`,
`host_history_base`, and `host_catalog_history_base` tables. The foreign
key to the `iam_scope_hst` table references the project scope of the
target at the time of the recording.
2023-05-31 12:18:17 +00:00
Michael Gaffney 73b710cd06 refactor(sql): Rename session recording migration
This renames the migration with the session recording table to come
after the history table migrations. This allows the session recording
table to have foreign key references to the history tables without using
alter table statements.
2023-05-31 12:18:17 +00:00
Michael Gaffney 37c6b8e540 feat(sql): Add history tables for hosts
This adds history tables for `static_host` and `host_plugin_host`. This
also adds a base table for the host history tables.

This also adds a new test to the history table test suite. The new test
verifies the contents of each history table against the contents of
their operational table.
2023-05-31 12:18:16 +00:00
Michael Gaffney b97dc07bb0 feat(sql): Add history tables for host catalogs
This adds history tables for `static_host_catalog` and
`host_plugin_catalog`. This also adds a base table for the host catalog
history tables and an immutable table with one row for when a target has
a direct address assigned to it.

This also adds a reusable trigger function for tables that are
immutable.
2023-05-31 12:18:16 +00:00
Michael Gaffney 7ebe393aee feat(sql): Add history table for target_ssh
This adds a history table for `target_ssh`.

This also fixes a bug in the history table test suite. Prior to this
change, the operational table name was calculated from the history table
name using the SQL trim() function. The SQL trim function as used
returned 'targe' for 'target_ssh_hst' instead of the expected value
'target_ssh'.
2023-05-31 12:18:16 +00:00
Michael Gaffney 882b7eca2f feat(sql): Add IAM history table references to session recording
This adds two columns to the `recording_session` table. One column is a
foreign key to the `iam_user_hst` table and the other is a foreign key
to the `iam_scope_hst` table. The foreign key to the `iam_scope_hst`
table reference the IAM scope the user belongs to at the time of the
recording.
2023-05-31 12:18:14 +00:00
Michael Gaffney 9fd01a79f0 refactor(sql): Move and rename session recording migration
This moves and renames the migration with the session recording table to
come after the history table migrations. This allows the session
recording table to have foreign key references to the history tables
without using alter table statements.
2023-05-31 12:18:14 +00:00
Michael Gaffney 4488f5f8cd refactor(sql): Move and rename history table migrations
This moves and renames the history table migration files into the
correct migration directory.
2023-05-31 12:18:14 +00:00
Michael Gaffney 463f1e36af feat(sql): Add history table for iam_user
This adds a history table for `iam_user`.
2023-05-31 12:18:14 +00:00
Michael Gaffney 8ae658a570 feat(sql): Add history table and triggers for iam_scope
This adds a history table for `iam_scope`. It also includes reusable
triggers to maintain the included history table and future history
tables.

This also includes a test suite that runs on any table ending in `_hst`.
2023-05-31 12:18:14 +00:00
Michael Gaffney 327d950a1e feat(sql): Add function to generate a URL safe ID
This adds a SQL function that generates a secure random ID of at least
14 characters suitable for use as a public or private ID. IDs generated
with the function will only contain characters from the unreserved
character set defined in RFC 3986 Section 2.3 making them safe for use
in a URL.
2023-05-31 12:18:14 +00:00
Michael Gaffney 94f77d36b3 feat(sql): Add a domain type for URL safe IDs
This creates a new domain in SQL that constrains the characters of an ID
to the unreserved character set defined RFC 3986 Section 2.3.
2023-05-31 12:18:13 +00:00
Michael Gaffney 647cf0d33d feat(sql): Add URL safe base64 encoding function
This adds a SQL function to encode binary data into the URL safe base64
encoding defined in RFC 4648.
2023-05-31 12:18:13 +00:00
Michael Gaffney f114e20c6d docs(db): fix comments on database domain types
Fixes the comments on the wt_scope_id, wt_user_id, and wt_role_id domain
types.
2022-10-26 08:27:38 -04:00
Michael Gaffney ed4b00303a docs(db): fix comments on kms database tables
Fixes the comments on the kms_data_key and kms_data_key_version tables.
2022-10-26 08:19:43 -04:00
Michael Gaffney c9cfb0e564 docs(db): fix comments on oidc database tables
Fixes the comments on the auth_oidc_method and auth_oidc_account tables.
2022-10-26 08:01:14 -04:00
Michael Gaffney 3241c9a411 docs(db): fix comments on database functions
Fixes the comments on functions wt_add_seconds, wt_add_seconds_to_now,
wt_sub_seconds, and wt_sub_seconds_from_now which were the tragic
victims of a copypasta error.
2022-10-26 06:34:36 -04:00
Michael Gaffney 1fa79e9aa1 test(db): Add tests for inserts into target_host_set 2022-08-22 12:15:20 -07:00
Michael Gaffney 0512ddb060 test(db): Add tests for inserts into target_credential_library 2022-08-22 12:15:20 -07:00
Michael Gaffney a6d9c228aa Merge branch 'mgaffney-greppable-sql' 2022-08-10 18:25:31 -04:00
Michael Gaffney f71eb764d9 docs: add SQL style guide 2022-08-10 15:25:46 -04:00
Michael Gaffney ac6f14a37f style(sql): make migrations more greppable 2022-08-08 18:17:57 -04:00
Michael Gaffney 661d6a551e test(tcp): only host sets from the same project can be added to a target 2022-08-04 12:01:01 -04:00
Michael Gaffney b6da1ccac7 feat(db): add static credential store schema 2022-06-14 13:01:17 -07:00
Michael Gaffney eece174e5e test(worker): Fix TestDeleteWorker 2022-05-31 13:57:50 -04:00
Michael Gaffney 4636d34943 test(credential): Add credential mapping override to delete test 2021-12-16 10:01:43 -05:00
Michael Gaffney 888f8cea03 test(credential): Add credential mapping override to list test 2021-12-16 10:01:43 -05:00
Michael Gaffney 035182681a feat(credential): Allow updating of credential mapping overrides 2021-12-16 09:52:18 -05:00
Michael Gaffney 9cdfc5f986 docs(vault): Add comment about the default value of HttpMethod 2021-12-16 09:52:18 -05:00
Michael Gaffney ba8188e6d7 feat(credential): Add mapping override to credential library on lookup
This change returns any mapping override set on a credential library
when the library is retrieved from the repository using the lookup
method.
2021-12-16 09:52:18 -05:00
Michael Gaffney 0e637f47b5 feat(credential): Use credential type when issuing credentials
This change uses the credential type attribute when issuing credentials
including mapping overrides.
2021-12-16 09:52:16 -05:00
Michael Gaffney 17762ed01e test(vault): Fix use of assert library in tests 2021-12-16 09:43:34 -05:00
Michael Gaffney c317901db4 feat(credential): add credential type to credential library on create
This change adds a credential type attribute to credential library and
allows it to be set when creating a credential library.

Specifying the type of credential returned from a library allows for new
features and additional error checking to be added over time. A
User Password credential type and an Unspecified credential type are
included with the expectation that additional credential types will be
added in the future. This change also adds the credential type attribute
to existing credential libraries and sets it to Unspecified.

Known Limitations:

- Credential type is only supported on the repository create method.
  Support for the other CRUD methods will be added in the future.
2021-12-16 09:43:32 -05:00
Michael Gaffney 54a508ef7f Merge branch 'mgaffney-sqltest-port' 2021-11-17 08:50:57 -05:00
Michael Gaffney 55c6c5872f feat(sqltest): Make container port configurable 2021-11-17 08:04:56 -05:00
Michael Gaffney 7ccab48a3c style: Run make fmt 2021-10-11 16:00:32 -04:00
Michael Gaffney 0b5ac930ac Fix godoc wording 2021-05-12 12:22:04 -04:00
Michael Gaffney b8831b16f1 Fix some minor godoc problems 2021-05-12 11:43:03 -04:00
Michael Gaffney 120b5e4c79 Run make migrations 2021-05-05 10:53:08 -04:00
Michael Gaffney 88c3fdc043 Fix godoc spelling 2021-05-04 10:38:33 -04:00
Michael Gaffney f130563da7 Run make fmt 2021-05-04 09:23:35 -04:00
Michael Gaffney ecc9d6d649 Run make fmt 2021-05-03 13:38:29 -04:00
Michael Gaffney 95e5db3aa3 Fix godoc wording 2021-05-03 12:48:39 -04:00
Michael Gaffney a7ba27148b Fix godoc wording 2021-04-27 08:26:08 -04:00
Michael Gaffney 3fe94335d4 Run make fmt 2021-04-23 13:19:28 -04:00
Michael Gaffney 78159eef9c Fix godoc spelling and white space 2021-04-17 12:36:21 -04:00
Michael Gaffney 3130bd615e Fix go doc: remove sentence fragment 2021-04-12 11:32:27 -04:00
Michael Gaffney f24e478542 Fix link in website README file 2020-10-08 12:40:41 -04:00
Michael Gaffney 6a8fd56864 Fix after merging in #90 2020-06-01 10:27:49 -04:00
Michael Gaffney be97e5cac8 Remove dead code 2020-05-29 14:21:30 -04:00