Skip to content

Commit

Permalink
fixes #1176 add a status code for OBJECT_NOT_UNIQUE (#1177)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehu authored Mar 20, 2022
1 parent dc41f72 commit 963c6f0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public void onStartup() {
}
}
}
System.out.println(ruleString);
rules = RuleMapper.string2RuleMap(ruleString);
if(logger.isInfoEnabled()) logger.info("Load YAML rules with size = " + rules.size());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ public void longlivedLightPortalController() throws Exception {
System.out.println("***Long lived token for portal controller ***: " + jwt);
}

@Test
public void longlivedPortalAdmin() throws Exception {
JwtClaims claims = ClaimsUtil.getTestClaims("stevehu@lightapi.net", "EMPLOYEE", "f7d42348-c647-4efb-a52d-4c5787421e73", Arrays.asList("portal.r", "portal.w"), "user admin CtlPltAdmin CtlPltRead CtlPltWrite");
claims.setExpirationTimeMinutesInTheFuture(5256000);
String jwt = JwtIssuer.getJwt(claims);
System.out.println("***Long lived token for portal admin ***: " + jwt);
}

@Test
public void longlivedLightPortalConfigServer() throws Exception {
JwtClaims claims = ClaimsUtil.getTestClaims("stevehu@gmail.com", "EMPLOYEE", "f7d42348-c647-4efb-a52d-4c5787421e73", Arrays.asList("portal.r", "portal.w"), "user CfgPltAdmin CfgPltRead CfgPltWrite");
Expand Down
5 changes: 5 additions & 0 deletions status/src/main/resources/config/status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,11 @@ ERR10069:
code: ERR10069
message: ACCESS_CONTROL_MISSING
description: Access control rule is missing for endpoint %s and default deny is true.
ERR10070:
statusCode: 400
code: ERR10070
message: OBJECT_NOT_UNIQUE
description: The object %s is not unique with value %s.

# 11000-11499 swagger-validator errors
ERR11000:
Expand Down

0 comments on commit 963c6f0

Please sign in to comment.