-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added canary service account configuration to be authenticated via OA…
…UTH over PLAIN (#482) * Configured internal TLS listener with OAUTH over PLAIN authentication Added the serviceAccounts to the ManagedKafka spec and status Added canary configuration with service account Signed-off-by: Paolo Patierno <[email protected]> * Fixed unit tests Signed-off-by: Paolo Patierno <[email protected]> * Removed useless annotation on SA manager Signed-off-by: Paolo Patierno <[email protected]> * Removed service accounts manager Signed-off-by: Paolo Patierno <[email protected]>
- Loading branch information
Showing
9 changed files
with
161 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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
75 changes: 75 additions & 0 deletions
75
api/src/main/java/org/bf2/operator/resources/v1alpha1/ServiceAccount.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package org.bf2.operator.resources.v1alpha1; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import io.sundr.builder.annotations.Buildable; | ||
import lombok.ToString; | ||
|
||
import javax.validation.constraints.NotNull; | ||
|
||
/** | ||
* Define a service account to be used by a specific Kafka instance component (i.e. canary) | ||
* to authenticate to Kafka brokers through the authentication service (i.e. Keycloak) | ||
*/ | ||
@Buildable( | ||
builderPackage = "io.fabric8.kubernetes.api.builder", | ||
editableEnabled = false | ||
) | ||
@ToString | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class ServiceAccount { | ||
|
||
public enum ServiceAccountName { | ||
Canary; | ||
|
||
public static ServiceAccountName forValue(String value) { | ||
switch (value) { | ||
case "canary": | ||
return Canary; | ||
default: | ||
return null; | ||
} | ||
} | ||
|
||
public String toValue() { | ||
switch (this) { | ||
case Canary: | ||
return "canary"; | ||
default: | ||
return null; | ||
} | ||
} | ||
} | ||
|
||
// using String and not the enum because fabric8 CRD generator doesn't allow to serialize as "canary" using a @JsonProperty for example | ||
// opened GitHub issue for this: https://github.com/fabric8io/kubernetes-client/issues/3411 | ||
@NotNull | ||
private String name; | ||
@NotNull | ||
private String principal; | ||
@NotNull | ||
private String password; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getPrincipal() { | ||
return principal; | ||
} | ||
|
||
public void setPrincipal(String principal) { | ||
this.principal = principal; | ||
} | ||
|
||
public String getPassword() { | ||
return password; | ||
} | ||
|
||
public void setPassword(String password) { | ||
this.password = password; | ||
} | ||
} |
This file contains 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 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 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 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 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