Commit Graph
100 Commits
Author SHA1 Message Date
6b53766aa6 internal/proto: improvements to OpenAPIv2 spec (#4555)
* internal/gen: better API docs

Add various pieces of metadata that can be used by the API docs renderer.
Improve the service labels by specifying explicit tags.
Specify error responses. Specify version at generation time.

* internal/gen: add better errors

The default error entry is now used to cover all errors, as
adding a new error for every possible status code was a bit much.
This also properly includes the real error type now!

* Add various pieces of metadata that can be used by the API docs renderer. Improve the service labels by specifying explicit tags.

* make auth method API docs

* make API docs better

* make auth methods API docs nicer

* internal/gen: better attribute examples

Replace Output Only comments with a field behavior annotation in accounts.
Mark some fields as required.
Add elaborate description for attributes.

* Make API docs better

* Make API docs better

* Make API docs better

* internal/proto: regenerate files

* internal/proto: finish off account service

* Make API docs better

* internal/proto: add better API docs for aliases

* Tidy up service descriptions

* Added description for Boundary controller  API doc

* internal/gen: add better API intro

Copy parts of the API docs into the description

* sdk: add openapi dependency

* internal/gen: move global API doc to separate file

* internal/gen: remove required annotations

Unfortunately, while these help with the creating of resources, they still
appear required in contexts where they are not, such as when
updating a resource.

* Review comments

---------

Co-authored-by: jigar-hashicorp <jigar.shah@hashicorp.com>
Co-authored-by: Isaac Christian (he/him) <112639904+isaacchristian@users.noreply.github.com>
2024-04-08 13:55:17 -07:00
Johan Brandhorst-Satzkorn dd206bb419 deps: update go-jose (#4568)
Apparently 3.0.1 has a vulnerability
2024-03-22 12:56:30 -07:00
Johan Brandhorst-Satzkorn e95eda7ca2 handlers: always return pagination parameters in list (#4373)
* handlers/targets: always return pagination parameters in list

* handlers/authmethods: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/accounts: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/authtokens: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/credentiallibraries: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/credentials: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/credentialstores: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/groups: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/host_catalogs: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/host_sets: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/hosts: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/managed_groups: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/roles: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/scopes: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/sessions: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.

* handlers/users: test for pagination parameters

Note that this already always returned the pagination parameters,
but now we have a test that it does so.
2024-02-15 09:26:29 -08:00
Johan Brandhorst-Satzkorn be252e3447 testing/e2e: add option to skip slow test (#4380) 2024-02-08 10:19:09 -08:00
Johan Brandhorst-Satzkorn c334ec700c enos: support max_page_size in AWS scenarios (#4352) 2024-02-02 09:21:21 -08:00
Johan Brandhorst-Satzkorn d9c6de4e8b deps: update runc dependency (#4349)
Fixes GHSA-xr7r-f8xq-vfvv
2024-02-01 13:19:24 -08:00
Johan Brandhorst-Satzkorn fa38d37ba7 Add note about breaking list change (#4328) 2024-01-30 16:03:19 -08:00
Johan Brandhorst-Satzkorn 7fe9198bce testing/e2e: paginate managed groups (#4315) 2024-01-29 13:56:25 -08:00
Johan Brandhorst-Satzkorn 0bddb346e5 testing/e2e: add account pagination test (#4314) 2024-01-29 13:22:21 -08:00
Johan Brandhorst-Satzkorn d47d2ad2e4 testing/e2e: add auth token pagination tests (#4311) 2024-01-29 11:51:40 -08:00
Johan Brandhorst-Satzkorn 72c87e81cf internal/authtoken: use view for listing (#4284)
Use the existing auth token account view for listing
instead of a custom query. Testing shows that the
performance difference is negligible, and this is simpler.
2024-01-25 13:48:43 -08:00
Johan Brandhorst-Satzkorn 133e928c6d internal/db/schema: update recording indexes (#4278)
The new index includes the new delete_time and
delete_after columns, which are used in the list query.
2024-01-25 08:56:15 -08:00
Johan Brandhorst-Satzkorn b229ece914 internal/db: use more efficient index for host listing (#4256)
In tests, the index including the catalog_id performs significantly
better.
2024-01-19 10:59:18 -08:00
Johan Brandhorst-Satzkorn 07be75b7be internal/handlers: add pagination to storage policies 2024-01-16 13:53:44 -08:00
Johan Brandhorst-Satzkorn b454b28912 internal/handlers: add policy list resource type 2024-01-16 13:53:44 -08:00
Johan Brandhorst-Satzkorn dc4ea67d6e internal/db: changes for pagination 2024-01-16 13:53:44 -08:00
Johan Brandhorst-Satzkorn edc616ea9d dep: upgrade vulnerable deps (#4235)
These dependencies triggered warnings in our
release workflow.
2024-01-16 09:41:48 -08:00
Johan Brandhorst-Satzkorn ada0c273b0 testing/e2e: add scope pagination test (#4233) 2024-01-16 09:22:28 -08:00
Johan Brandhorst-Satzkorn c2a9723a10 testing/e2e: add group pagination test (#4234) 2024-01-16 09:22:16 -08:00
Johan Brandhorst-Satzkorn 0bb9e745b7 testing/e2e: add role pagination test (#4232) 2024-01-15 13:30:49 -08:00
Johan Brandhorst-Satzkorn fb2aa30e80 Merge pull request #4095 from hashicorp/mikemountain-adjust-session-pagination-queries
Update session query with optimized indexes
2024-01-11 09:45:09 -08:00
Johan Brandhorst-Satzkorn 9a23bd14f0 internal/session: tidy up query 2024-01-11 09:44:44 -08:00
Johan Brandhorst-Satzkorn b6fe9824ab internal/db: optimize session list indexes 2024-01-11 09:44:44 -08:00
Johan Brandhorst-Satzkorn 77e1f01421 website: correct grammar (#4222) 2024-01-05 07:45:14 -08:00
Johan Brandhorst-Satzkorn 7c15d7ff60 Update changelog for list pagination (#4220) 2024-01-05 07:45:09 -08:00
Johan Brandhorst-Satzkorn 1303f7c363 Fix linter warnings (#4219) 2024-01-05 07:43:22 -08:00
Johan Brandhorst-Satzkorn 69262c386c internal/db: renumber migrations (#4218) 2024-01-05 07:43:22 -08:00
Johan Brandhorst-Satzkorn 3daa55b913 internal/handlers: add scope list pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn ad5b34da6b internal/iam: add scope list pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 85ca909720 internal/db: add iam_scope indexes
These will help the iam_scope list queries
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn eb78943cdb testing/e2e: add host catalogs end to end test (#4214) 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn d4b60241db internal/db: storage bucket pagination migrations (#4213) 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn b7e474d277 internal/handlers: add accounts pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn d5e8877f2c internal/auth/password: add account pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 1452952ddb internal/auth/oidc: add account pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 6281a5b73c internal/auth/ldap: add account pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 44971b3559 internal/db: migrations for accounts pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 0715003945 internal/db: renumber session recording migration 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn b6c2e900ba internal/authtoken: join to auth_account to filter (#4198)
Instead of doing the scope_id filtering in the second CTE,
join the auth_account table to the auth_token table
in the query directly.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn cce52a16e6 internal/db: db migrations for session recordings (#4200) 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn f38c79a5ce internal/handlers: add host catalog pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn c0c28c63bc internal/host: add pagination support to catalogs 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn e9b90d9ce1 internal/db: add schema changes for host catalog pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn f0dbddb9e3 internal/db: ensure new columns are not null (#4197)
Ensure the new create_time and update_time columns
are marked as not null after populating the data.
Also ensure that the data is populated safely with an
updated query pattern inspired by the auth method
pattern.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 8dc431fef5 internal/db: renumber auth methods migration (#4199) 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn db21fbb7c1 internal/host/plugin: revert unnecessary method change
This logic was accidentally updated to support pagination
when it's no longer used. Revert it back to the original code.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn b3207d8e1c internal/host: sort public_id descending
The previous sort would run the risk of missing items which
collide on update or create times because of the compound
comparison using strictly less than for both the timestamp
and the public_id. Sorting both descending avoids this issue.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn d94a25bbd2 internal/host: sort public_id descending
The previous sort would run the risk of missing items which
collide on update or create times because of the compound
comparison using strictly less than for both the timestamp
and the public_id. Sorting both descending avoids thi issue.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn d4f5677858 internal/iam: sort public_id descending
The previous sort would run the risk of missing items which
collide on update or create times because of the compound
comparison using strictly less than for both the timestamp
and the public_id. Sorting both descending avoids thi issue.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn f9950a7e1c internal/authtoken: sort public_id descending
The previous sort would run the risk of missing items which
collide on update or create times because of the compound
comparison using strictly less than for both the timestamp
and the public_id. Sorting both descending avoids thi issue.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn d4d1efce93 internal/session: sort public_id descending
The previous sort would run the risk of missing items which
collide on update or create times because of the compound
comparison using strictly less than for both the timestamp
and the public_id. Sorting both descending avoids thi issue.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 6238a533b0 internal/credential: sort public_id descending
The previous sort would run the risk of missing items which
collide on update or create times because of the compound
comparison using strictly less than for both the timestamp
and the public_id. Sorting both descending avoids thi issue.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn fc9b26efa7 internal/target: sort public_id descending
The previous sort would run the risk of missing items which
collide on update or create times because of the compound
comparison using strictly less than for both the timestamp
and the public_id. Sorting both descending avoids thi issue.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 050bcdfec9 handlers/host_sets: implement pagination for host sets
Adds protobuf types and handler logic to support pagination of host sets.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn e14c1382b3 internal/host: add static host set pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 4ba521a3e0 internal/host: add plugin host set pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 27393a8227 internal/db: add host set indexes 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 6757510205 internal/session: add helper for listing sessions
This is used in an enterprise test
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn f29d559d60 handlers/session_recordings: add pagination support 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 24130c4313 handlers/storage_buckets: add pagination fields 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 516d7b3486 internal/storage: support pagination for storage buckets 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 8c3e309816 internal/storage/plugin: run tests in parallel 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 1a6e2fc5b1 internal/storage: fix options test
An assert created in the parent was being used in subtests,
which will attribute test failures incorrectly.
Also run tests in parallel.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 16eab12458 internal/plugin: fix typo 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 5ef1a39727 internal/credential: use simpler query arg 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 61642f8b5f internal/authtoken: use simpler query arg 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 9b40cf0801 internal/iam: validate token resource type 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 025ef0d9ca internal/target: validate token resource type 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 3288f78f12 internal/session: validate token resource type 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 12403d49ad internal/credential: validate token resource type 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 799009fc04 internal/authtoken: validate token resource type 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 597ac645b2 internal/handlers: fix some comments 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 7190042f8e internal/credential: 🤦 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn bf1e44afd6 internal/pagination: add notes about plugin map 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn a237157b91 internal/listtoken: remove validation depending on application time
All times in the list tokens are sourced from the database,
and any comparisons to times in the application can
cause false positive validation errors. We've observed
this from multiple users of the pagination logic, and
the value of this validation is very little compared
to the cost of a single false positive error like this
happening to a real world customer. Therefore, remove
any list token validation using the application time,
except the one monitoring for token expiry, which
should not suffer from the issue to a degree
that matters to our users.

Also refactor validation such that the list token subtype
constructors only perform sanity checks on the values
while punting business logic validation to the validate
method on the new token. This means we avoid
duplicating logic.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn f89e53d5f0 internal/handlers: tidy up test times 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn bcddef87a2 internal/pagination: stop using unknown resource type 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 17b6ad5c5c handlers/hosts: implement pagination for hosts
Adds protobuf types and handler logic to support pagination of hosts.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn cea80413c9 internal/host: add static host pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 473facbc5f internal/host: add plugin host pagination 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn faf7ebce85 internal/host: add pagination options
Add options to support pagination of hosts, host sets and host catalogs.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 21c593ab71 internal/db: add host indexes 2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 8175086be7 internal/pagination: avoid import cycle
The iam package is very foundational, and now depends
on the pagination package. Thus, the pagination package
must not import any packages that may import iam,
such as the plugin package. Move the plugin helpers
to a subdirectory to avoid this import cycle.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn df93313b9a all: fix test failures after rebase
The stability of the authorized_actions have been removed in main,
so we need to add these sorts to all our new tests.
2024-01-05 07:43:21 -08:00
Johan Brandhorst-Satzkorn 77b76ae685 internal/db: reorder pagination schema files 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 6c9bc84790 testing/e2e: add credential store pagination test 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 0259f2f26b internal/handlers: add credential store pagination 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn a7ebb7a3ef internal/credential: add store pagination logic 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 3197ab763f internal/credential/static: add store pagination logic 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 7efb43ac03 internal/credential/vault: add store pagination logic 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 22ce2b4468 internal/db: add cred store pagination schema changes
Add create time, update time columns to base table,
add indexes used by list queries.
2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 7b27d7d20f internal/target: fix some test typos 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 576e25bd27 internal/session: fix some test typos 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn dc0b8cfc62 internal/credential: fix some test typos 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn cb109da5b2 internal/pagination: add generic ListPlugins functions
These new methods can be used in places where the caller wants
to automatically paginate over a resource that is returned
together with a slice of plugins, such as host catalogs.
2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 97ba8b3bad internal/pagination: add generic ListPlugin functions
These new methods can be used in places where the caller wants
to automatically paginate over a resource that is returned
together with a plugin, such as plugin hosts, host sets and storage buckets.
2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 1411eeafff testing/e2e: add credential library pagination test 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 9047d5b22a testing/e2e: add credential store API helper 2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 780dfe20ad internal/db: move pagination migrations to same folder (#4142)
Since rebasing on main, we are no longer working in 79, but 80 instead.
2024-01-05 07:43:20 -08:00
Johan Brandhorst-Satzkorn 7dce5396f5 testing/e2e: add API helper for u/pw credentials 2024-01-05 07:43:20 -08:00