forked from baron/baron-sso
tenant 제한 에러 처리 보안
This commit is contained in:
@@ -153,6 +153,37 @@ void main() {
|
||||
},
|
||||
);
|
||||
|
||||
test(
|
||||
'acceptOidcLogin error는 code/message/details를 AuthProxyException으로 보존한다',
|
||||
() async {
|
||||
client.enqueueJson({
|
||||
'code': 'tenant_not_allowed',
|
||||
'error': 'tenant blocked',
|
||||
'details': {
|
||||
'allowed_tenants': ['gp'],
|
||||
},
|
||||
}, statusCode: 403);
|
||||
|
||||
await expectLater(
|
||||
AuthProxyService.acceptOidcLogin('login-challenge', token: 'jwt'),
|
||||
throwsA(
|
||||
isA<AuthProxyException>()
|
||||
.having(
|
||||
(error) => error.errorCode,
|
||||
'code',
|
||||
'tenant_not_allowed',
|
||||
)
|
||||
.having((error) => error.message, 'message', 'tenant blocked')
|
||||
.having(
|
||||
(error) => error.details?['allowed_tenants'],
|
||||
'details',
|
||||
['gp'],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
test(
|
||||
'approveQrLogin은 credential mode와 bearer token payload를 지원한다',
|
||||
() async {
|
||||
|
||||
Reference in New Issue
Block a user