-
-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(auth): attributes are not mapped to the claim with RestApiClaimPr…
- Loading branch information
1 parent
49b7c0f
commit 01d2eef
Showing
14 changed files
with
135 additions
and
125 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,6 @@ | ||
package org.akhq.utils; | ||
|
||
import io.micronaut.core.annotation.Introspected; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public interface ClaimProvider { | ||
|
||
AKHQClaimResponse generateClaim(AKHQClaimRequest request); | ||
|
||
enum ProviderType { | ||
HEADER, | ||
BASIC_AUTH, | ||
LDAP, | ||
OIDC | ||
} | ||
|
||
@Introspected | ||
@Builder | ||
@Getter | ||
@Setter | ||
class AKHQClaimResponse { | ||
private List<String> roles; | ||
private Map<String,Object> attributes; | ||
} | ||
|
||
@Introspected | ||
@Builder | ||
@Getter | ||
@Setter | ||
class AKHQClaimRequest{ | ||
ProviderType providerType; | ||
String providerName; | ||
String username; | ||
List<String> groups; | ||
} | ||
ClaimResponse generateClaim(ClaimRequest request); | ||
|
||
} |
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,8 @@ | ||
package org.akhq.utils; | ||
|
||
public enum ClaimProviderType { | ||
HEADER, | ||
BASIC_AUTH, | ||
LDAP, | ||
OIDC | ||
} |
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,19 @@ | ||
package org.akhq.utils; | ||
|
||
import io.micronaut.core.annotation.Introspected; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.List; | ||
|
||
@Introspected | ||
@Builder | ||
@Getter | ||
@Setter | ||
public class ClaimRequest { | ||
ClaimProviderType providerType; | ||
String providerName; | ||
String username; | ||
List<String> groups; | ||
} |
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,26 @@ | ||
package org.akhq.utils; | ||
|
||
import io.micronaut.core.annotation.Introspected; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@Introspected | ||
@Builder | ||
@Getter | ||
public class ClaimResponse { | ||
private List<String> roles; | ||
private List<String> topicsFilterRegexp; | ||
private List<String> connectsFilterRegexp; | ||
private List<String> consumerGroupsFilterRegexp; | ||
|
||
public Map<String, Object> getAttributes() { | ||
return Map.of( | ||
"topicsFilterRegexp", topicsFilterRegexp, | ||
"connectsFilterRegexp", connectsFilterRegexp, | ||
"consumerGroupsFilterRegexp", consumerGroupsFilterRegexp | ||
); | ||
} | ||
} |
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
Oops, something went wrong.