-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Octavia CLI uses Basic Auth #17982
Octavia CLI uses Basic Auth #17982
Conversation
try: | ||
assert isinstance(self.name, str) and self.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how come the isinstance
check was removedf?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because above we forced everything to be a string.... so it's a string. This was needed to get around some test/mock issues. Logically, what we cared about anyway was the string's length... so let's check that specifically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checks out
self.name = str(self.name) | ||
self.value = str(self.value) | ||
try: | ||
assert isinstance(self.name, str) and self.name | ||
assert isinstance(self.value, str) and self.value | ||
assert len(self.name) > 0 | ||
assert len(self.value) > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern with this is that most python types can be casted to string without error.
e.g passing a dict
as name or value will result in a non-empty casted string...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem was that in test_get_api_client
the airbyte_api_client
is patched to a mock object, its attributes and calls to its methods return Mock
objects: Configuration
is a mock, calling Configuration.get_basic_auth_token
returns a Mock too. So when calling ApiHttpHeader("Authorization", basic_auth_token)
the basic auth token is a mock and its failing __post_init__
.
The solution to this testing problem is to patch the return_value
of get_basic_auth_token
to return a string.
This is what I did in 4ad020f
* Use Nginx + Basic Auth to secure OSS Airbyte * use local passwords * Use gradle builds * K8s setup and source values from ENV * note about disabling * add back defaults * custom 401 page * update http message * update docs * remove kube files * additional doc updates * Add a test suite * fix failure exit codes * doc updates * Add docs * bump to re-test * add more sleep in tests for CI * better sleep in test * Update docs/operator-guides/security.md Co-authored-by: Davin Chia <[email protected]> * PR updates * test comment * change test host on CI * update tests and nginx to boot without backend * proxy updates for docker DNS * simpler test for uptime * acceptance test skips PWs * remove resolver madness * fixup tests * more proxy_pass revert * update acceptance test exit codes * relax test expectations * add temporal mount back for testing * Update docs/operator-guides/security.md Co-authored-by: swyx <[email protected]> * Update airbyte-proxy/401.html Co-authored-by: swyx <[email protected]> * more doc updates * Octavia CLI uses Basic Auth (#17982) * [WIP] Octavia CLI uses Basic Auth * readme * augustin: add basic auth headers to clien * augustin: add basic auth headers to client * tests passing * lint * docs * Move monkey patch to test * coerce headers into strings * monkey patch get_basic_auth_token Co-authored-by: alafanechere <[email protected]> * fix launch permissions * Keep worker port internal * more readme Co-authored-by: Davin Chia <[email protected]> Co-authored-by: swyx <[email protected]> Co-authored-by: alafanechere <[email protected]>
* Use Nginx + Basic Auth to secure OSS Airbyte * use local passwords * Use gradle builds * K8s setup and source values from ENV * note about disabling * add back defaults * custom 401 page * update http message * update docs * remove kube files * additional doc updates * Add a test suite * fix failure exit codes * doc updates * Add docs * bump to re-test * add more sleep in tests for CI * better sleep in test * Update docs/operator-guides/security.md Co-authored-by: Davin Chia <[email protected]> * PR updates * test comment * change test host on CI * update tests and nginx to boot without backend * proxy updates for docker DNS * simpler test for uptime * acceptance test skips PWs * remove resolver madness * fixup tests * more proxy_pass revert * update acceptance test exit codes * relax test expectations * add temporal mount back for testing * Update docs/operator-guides/security.md Co-authored-by: swyx <[email protected]> * Update airbyte-proxy/401.html Co-authored-by: swyx <[email protected]> * more doc updates * Octavia CLI uses Basic Auth (airbytehq#17982) * [WIP] Octavia CLI uses Basic Auth * readme * augustin: add basic auth headers to clien * augustin: add basic auth headers to client * tests passing * lint * docs * Move monkey patch to test * coerce headers into strings * monkey patch get_basic_auth_token Co-authored-by: alafanechere <[email protected]> * fix launch permissions * Keep worker port internal * more readme Co-authored-by: Davin Chia <[email protected]> Co-authored-by: swyx <[email protected]> Co-authored-by: alafanechere <[email protected]>
Closes #17971
This PR (merged into #17694, not
master
) Updates the Octavia CLI to use HTTP Basic Auth by default. Without this PR, the CLI couldn't connect to any server which was using Basic Auth.