fix(auth): @Autowired на WorkflowRoles main ctor
Класс имеет два constructor'а (main + test). Без явной @Autowired аннотации Spring может выбрать no-arg ctor → props=null → rolesClaimPath() fallback на realm_access.roles несмотря на env var ORDINIS_AUTH_ROLES_CLAIM=resource_access.ordinis.roles. Симптом: 403 forbidden_role с message 'Требуется realm role: ordinis:schema:reviewer' для user с ordinis:admin в resource_access.ordinis.roles (super-role override не работал потому что currentRoles() возвращал пустой set из неправильного claim path). Fix: @Autowired на main ctor — Spring выбирает его, props инжектится, rolesClaim читается из env var правильно.
This commit is contained in:
+7
@@ -77,6 +77,13 @@ public class WorkflowRoles {
|
|||||||
|
|
||||||
private final OrdinisAuthProperties props;
|
private final OrdinisAuthProperties props;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spring autowire constructor. Без @Autowired Spring randomly выбирает
|
||||||
|
* один из multiple ctors — был bug что выбирался no-arg test ctor
|
||||||
|
* → props=null → fallback на default realm_access.roles (несмотря на
|
||||||
|
* env var ORDINIS_AUTH_ROLES_CLAIM=resource_access.ordinis.roles).
|
||||||
|
*/
|
||||||
|
@org.springframework.beans.factory.annotation.Autowired
|
||||||
public WorkflowRoles(OrdinisAuthProperties props) {
|
public WorkflowRoles(OrdinisAuthProperties props) {
|
||||||
this.props = props;
|
this.props = props;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user