-
Notifications
You must be signed in to change notification settings - Fork 1
Add password auth support #47
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,33 @@ The module supports several rollout strategies for Materialize instances through | |
- Must be changed to a new UUID value for each rollout | ||
|
||
To use these options, set the appropriate values in the `instances` input variable and when you want to rollout a new version of the instance, set the `request_rollout` or `force_rollout` value to a new UUID. | ||
|
||
## Authentication Options | ||
|
||
The module supports two authentication modes for Materialize instances: | ||
|
||
### `authenticator_kind` (string) | ||
- Determines how users authenticate with the Materialize instance. | ||
- Valid values are: | ||
- `"None"` (default): No password authentication is enabled. | ||
- `"Password"`: Enables password authentication for the `mz_system` user. When set to `"Password"`, you **must** provide a value for `external_login_password_mz_system`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is totally fine, but we could also generate one for them if they don't provide one. |
||
|
||
### `external_login_password_mz_system` (string) | ||
- The password to set for the `mz_system` user when `authenticator_kind` is `"Password"`. | ||
- This value is stored securely in a Kubernetes Secret and used by the Materialize operator to configure authentication. | ||
- **Required** if `authenticator_kind` is set to `"Password"`. | ||
|
||
**Example:** | ||
```hcl | ||
instances = [ | ||
{ | ||
name = "mz-instance" | ||
namespace = "mz-ns" | ||
authenticator_kind = "Password" | ||
external_login_password_mz_system = "your-secure-password" | ||
# other instance configurations | ||
} | ||
] | ||
``` | ||
|
||
If `authenticator_kind` is not set or set to `"None"`, password authentication is disabled and `external_login_password_mz_system` is ignored. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could we cause an error instead? I'm afraid someone might set
external_login_password_mz_system
and be confused that they can still log in without a password because they forgot to set theauthenticator_kind
.An even more intuitive scheme would be to only have a password, and if it's set, switch the authenticator kind to password, otherwise none.
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.
Good point! Just updated this.
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.
I do agree this is the easiest to use, but it's also creates an interface that doesn't map with the k8s crd or envd binary. In this case, I think the cleanest thing to do is mirror the underlying behavior.
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.
hm yes, I see your point. I do like the simplicity of the implicit behavior, but happy to revert the last change if @def- and @alex-hunt-materialize agree that staying closer to the original model is the better call here.
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.
We could also make it more intuitive in k8s crd/envd binary!
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.
From my experience it's generally acceptable to only read flags for a feature when that feature is enabled and to ignore them when the feature is disabled without error. This is especially true on the helm chart side.
I think keeping our logic to match the CRD (not doing any TF magic) is going to provide the best continuity of understanding as users dig deeper into problems and start looking at k8s directly. It's definitely possible that we want to simplify the crd/envd binary. I think we can resist that later, especially if the configuration gets more complex.