Skip to content

Commit 1da5201

Browse files
committed
fixed build and lint
1 parent a14d4b6 commit 1da5201

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

‎auth/src/main/java/feast/auth/authorization/Keto/KetoAuthorizationProvider.java‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public KetoAuthorizationProvider(Map<String, Object> options) {
4646
throw new IllegalArgumentException("Cannot pass empty or null options to KetoAuth");
4747
}
4848
ApiClient defaultClient = Configuration.getDefaultApiClient();
49-
defaultClient.setBasePath((String)options.get("basePath"));
49+
defaultClient.setBasePath((String) options.get("basePath"));
5050
this.apiInstance = new EnginesApi(defaultClient);
5151
this.options = options;
5252
}
@@ -59,9 +59,8 @@ public KetoAuthorizationProvider(Map<String, Object> options) {
5959
* @return AuthorizationResult result of authorization query
6060
*/
6161
public AuthorizationResult checkAccess(String project, Authentication authentication) {
62-
String subject = (String)this.options.get("subject");
63-
if ((subject == null) || (subject.isEmpty()))
64-
subject = "email";
62+
String subject = (String) this.options.get("subject");
63+
if ((subject == null) || (subject.isEmpty())) subject = "email";
6564
String subjectValue = getSubjectFromAuth(authentication, subject);
6665
try {
6766
// Get all roles from Keto
@@ -91,7 +90,7 @@ public AuthorizationResult checkAccess(String project, Authentication authentica
9190
}
9291
// Could not determine project membership, deny access.
9392
return AuthorizationResult.failed(
94-
String.format("Access denied to project %s for user %s", project, email));
93+
String.format("Access denied to project %s for user %s", project, subjectValue));
9594
}
9695

9796
/**
@@ -104,7 +103,7 @@ public AuthorizationResult checkAccess(String project, Authentication authentica
104103
private String getSubjectFromAuth(Authentication authentication, String subject) {
105104
Jwt principle = ((Jwt) authentication.getPrincipal());
106105
Map<String, Object> claims = principle.getClaims();
107-
String subjectValue = (String)claims.get(subject);
106+
String subjectValue = (String) claims.get(subject);
108107

109108
if (subjectValue.isEmpty()) {
110109
throw new IllegalStateException(String.format("JWT does not have a valid %s.", subject));

‎auth/src/main/java/feast/auth/config/SecurityProperties.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ public static class AuthorizationProperties {
5454
private String provider;
5555

5656
// K/V options to initialize the provider with
57-
private Map<String, String> options;
57+
private Map<String, Object> options;
5858
}
5959
}

0 commit comments

Comments
 (0)