trinodb / trino-gateway

https://trinodb.github.io/trino-gateway/
Apache License 2.0
122 stars 47 forks source link

Capitalize page permission key conf #352

Closed Chaho12 closed 4 weeks ago

Chaho12 commented 1 month ago

Description

Since both roles in web & security context are in upper-case, page permission should also be in upper case to match with roles.

Without this patch, user has to set upper-case key's in yaml in their yaml file as below, which is awkward as all other auth related confs are in lower-case.

pagePermissions:
  ADMIN:
  USER: dashboard_history
  API:

Additional context and related issues

Release notes

(x) This is not user-visible or is docs only, and no release notes are required. ( ) Release notes are required. Please propose a release note for me. ( ) Release notes are required, with the following suggested text:

* 

Test

pagePermissions:
  admin:
  user: dashboard_history
  api:

스크린샷 2024-05-23 오전 10 32 40 스크린샷 2024-05-23 오전 10 32 51

ebyhr commented 1 month ago

Please check CI failure:

Error:    TestLbAuthenticator.testNoLdapNoPresetUsers:122 » NullPointer Cannot invoke "java.util.Map.forEach(java.util.function.BiConsumer)" because "pagePermissions" is null
Error:    TestLbAuthenticator.testWrongLdapConfig:131 » NullPointer Cannot invoke "java.util.Map.forEach(java.util.function.BiConsumer)" because "pagePermissions" is null
ebyhr commented 1 month ago

Please fix CI failure:

Error:    TestLbAuthenticator.testNoLdapNoPresetUsers:122 » NullPointer Cannot invoke "java.util.Map.entrySet()" because "pagePermissions" is null
Error:    TestLbAuthenticator.testWrongLdapConfig:131 » NullPointer Cannot invoke "java.util.Map.entrySet()" because "pagePermissions" is null
ebyhr commented 4 weeks ago

Please fix CI failure:

Error:  src/main/java/io/trino/gateway/ha/security/LbOAuthManager.java:[52,1] (imports) ImportOrder: Wrong order for 'com.google.common.collect.ImmutableMap.toImmutableMap' import.
ebyhr commented 4 weeks ago

I pushed small changes because the indentation was wrong.