Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Operator Generated bootstrap token #12520

Merged
merged 71 commits into from
Jun 3, 2022
Merged
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
e9f4394
Working MVP - Admin Provided Bootstrap Token
lhaig Apr 8, 2022
cd62726
Update acl.go
lhaig Apr 8, 2022
0722f72
Update acl_bootstrap.go
lhaig Apr 8, 2022
cc0b3a4
Update acl_bootstrap.go
lhaig Apr 10, 2022
eb0699a
Update the flag name and some comments
lhaig Apr 11, 2022
67ca953
Updated the header name in the agent
lhaig Apr 11, 2022
e4a6924
Update Header Name Typo
lhaig Apr 11, 2022
8b046de
Validate ProvidedToken is a UUID
lhaig May 13, 2022
c435389
Update acl_endpoint.go
lhaig May 13, 2022
7143fa2
Refactor the ACL Bootstrap token code
lhaig May 13, 2022
2198fdf
Add Additional field to allow current test to pass
lhaig May 13, 2022
57ea2fe
Working MVP - Admin Provided Bootstrap Token
lhaig Apr 8, 2022
e85c104
Update the flag name and some comments
lhaig Apr 11, 2022
7a35037
Updated the header name in the agent
lhaig Apr 11, 2022
e4242ae
Update Header Name Typo
lhaig Apr 11, 2022
111181d
Validate ProvidedToken is a UUID
lhaig May 13, 2022
ec6115d
Refactor the ACL Bootstrap token code
lhaig May 13, 2022
908544b
Update acl_bootstrap_test.go
lhaig May 15, 2022
8587603
WIP: ACL Test for Operator token.
lhaig May 15, 2022
865892b
Working MVP - Admin Provided Bootstrap Token
lhaig Apr 8, 2022
7f5737b
Update acl_bootstrap.go
lhaig Apr 8, 2022
4af3111
Update the flag name and some comments
lhaig Apr 11, 2022
7fec7f8
Updated the header name in the agent
lhaig Apr 11, 2022
17cabf2
Update Header Name Typo
lhaig Apr 11, 2022
bade1e9
Refactor the ACL Bootstrap token code
lhaig May 13, 2022
cb2ae1f
Working MVP - Admin Provided Bootstrap Token
lhaig Apr 8, 2022
d25cee1
Updated the header name in the agent
lhaig Apr 11, 2022
3c7a0dc
Update Header Name Typo
lhaig Apr 11, 2022
24117d3
Refactor the ACL Bootstrap token code
lhaig May 13, 2022
46b515e
Update acl_test.go
lhaig May 16, 2022
363eabb
Update bootstrap.mdx
lhaig May 16, 2022
59c425b
Update api/acl_test.go
lhaig May 17, 2022
8bdbb52
Update command/acl_bootstrap.go
lhaig May 17, 2022
358a8a8
Update nomad/acl_endpoint.go
lhaig May 17, 2022
408940f
Update api/acl.go
lhaig May 17, 2022
7af15b4
Update command/acl_bootstrap_test.go
lhaig May 17, 2022
15f03e9
Update command/acl_bootstrap_test.go
lhaig May 17, 2022
e46f431
Update acl_bootstrap_test.go
lhaig May 17, 2022
b3fbae9
Separate out the new Bootstrap code into a separate method
lhaig May 17, 2022
867984f
Create 12520.txt
lhaig May 17, 2022
160a81d
Update acl-tokens.mdx
lhaig May 17, 2022
d48a705
Update website/content/api-docs/acl-tokens.mdx
lhaig May 17, 2022
1b40dec
Add the UUID requirement to the documentation
lhaig May 17, 2022
585ee2b
Update acl_bootstrap_test.go
lhaig May 17, 2022
e294174
Change Struct Field Name to be more descriptive
lhaig May 18, 2022
8f360a5
Remove the need for a header
lhaig May 22, 2022
9c798fa
Remove .vscode/launch.json
lhaig May 24, 2022
f790c36
Update api/acl.go
lhaig May 24, 2022
fc207de
Moved as per request
lhaig May 24, 2022
d739fbb
Update acl_bootstrap.go
lhaig May 25, 2022
2d16aaa
Update .gitignore
lhaig May 26, 2022
e93fc35
Update acl_bootstrap.go
lhaig May 26, 2022
b7aa487
Update acl_bootstrap_test.go
lhaig May 26, 2022
7bacf6f
Update acl_bootstrap_test.go
lhaig May 26, 2022
317ec5e
Update acl_endpoint_test.go
lhaig May 26, 2022
89b34ec
Update acl-tokens.mdx
lhaig May 26, 2022
ae2691c
Update 12520.txt
lhaig May 26, 2022
10289f1
Update bootstrap.mdx
lhaig May 26, 2022
e99c9c0
Update hashistack.tf
lhaig May 26, 2022
2de8f49
Update acl_endpoint_test.go
lhaig May 26, 2022
b138bbd
Update acl_endpoint.go
lhaig May 26, 2022
633cf82
Update acl_endpoint.go
lhaig May 26, 2022
c973e2d
Update bootstrap.mdx
lhaig May 26, 2022
8a0d393
Update api/acl.go
lhaig May 28, 2022
731936c
Update acl_bootstrap.go
lhaig May 28, 2022
5bccf03
Merge branch 'f-bootstrap-token' of github.com:hashicorp/nomad into f…
lhaig May 28, 2022
16ec53b
Update acl-tokens.mdx
lhaig May 28, 2022
2d7b315
Update api/acl.go
lhaig May 28, 2022
d716f3f
Revert Back to the ContentLength check
lhaig Jun 2, 2022
9ca6c63
test: manually set contentlength in tests
schmichael Jun 2, 2022
772d8ee
appease hclfmt
schmichael Jun 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: manually set contentlength in tests
  • Loading branch information
schmichael committed Jun 2, 2022
commit 9ca6c63a2be183d8c68dcbaa07ea8b43cf397b49
5 changes: 5 additions & 0 deletions command/agent/acl_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ func TestHTTP_ACLTokenBootstrapOperator(t *testing.T) {
if err != nil {
t.Fatalf("err: %v", err)
}

// Since we're not actually writing this HTTP request, we have
// to manually set ContentLength
req.ContentLength = -1
Comment on lines +244 to +246
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow this took me a while to figure out: since we're never actually writing this HTTP request, the stdlib code that sets ContentLength is never set!

Therefore in tests we need to set ContentLength to some nonzero value since tests do not use a real HTTP server.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am glad it is finally solved it kept me up a few nights :-)


respW := httptest.NewRecorder()
// Make the request
obj, err := s.Server.ACLTokenBootstrap(respW, req)
Expand Down