mirror of
https://github.com/valitydev/org-manager.git
synced 2024-11-06 00:15:23 +00:00
add requestId in logs + check invitation email ignore case (#48)
* add requestId in logs + check invitation email ignore case * fix test Co-authored-by: ggmaleva <ggmaleva@yandex.ru>
This commit is contained in:
parent
e4979f66c1
commit
5cc277db68
@ -27,7 +27,7 @@ public class UserController implements UserApi {
|
||||
public ResponseEntity<Void> cancelOrgMembership(
|
||||
String requestId,
|
||||
String orgId) {
|
||||
log.info("Cancel org membership: orgId={}", orgId);
|
||||
log.info("Cancel org membership: requestId={}, orgId={}", requestId, orgId);
|
||||
ResourceDto resource = ResourceDto.builder()
|
||||
.orgId(orgId)
|
||||
.build();
|
||||
@ -40,7 +40,7 @@ public class UserController implements UserApi {
|
||||
public ResponseEntity<OrganizationMembership> inquireOrgMembership(
|
||||
String requestId,
|
||||
String orgId) {
|
||||
log.info("Inquire org membership: orgId={}", orgId);
|
||||
log.info("Inquire org membership: requestId={}, orgId={}", requestId, orgId);
|
||||
ResourceDto resource = ResourceDto.builder()
|
||||
.orgId(orgId)
|
||||
.build();
|
||||
@ -53,7 +53,7 @@ public class UserController implements UserApi {
|
||||
public ResponseEntity<OrganizationMembership> joinOrg(
|
||||
String requestId,
|
||||
OrganizationJoinRequest body) {
|
||||
log.info("Join organization: body={}", body);
|
||||
log.info("Join organization: requestId={}, body ={}", requestId, body);
|
||||
ResourceDto resource = ResourceDto.builder()
|
||||
.invitationToken(body.getInvitation())
|
||||
.build();
|
||||
@ -67,7 +67,8 @@ public class UserController implements UserApi {
|
||||
public ResponseEntity<OrganizationSearchResult> listOrgMembership(String requestId,
|
||||
Integer limit,
|
||||
String continuationToken) {
|
||||
log.info("List org membership: limit={}, continuationToken={}", limit, continuationToken);
|
||||
log.info("List org membership: requestId={}, limit={}, continuationToken={}",
|
||||
requestId, limit, continuationToken);
|
||||
resourceAccessService.checkRights();
|
||||
AccessToken accessToken = keycloakService.getAccessToken();
|
||||
OrganizationSearchResult organizationSearchResult =
|
||||
|
@ -236,7 +236,7 @@ public class OrganizationService {
|
||||
@Transactional
|
||||
public OrganizationMembership joinOrganization(String token, String userId, String userEmail) {
|
||||
InvitationEntity invitationEntity = invitationService.findByToken(token);
|
||||
if (!userEmail.equals(invitationEntity.getInviteeContactEmail())) {
|
||||
if (!userEmail.equalsIgnoreCase(invitationEntity.getInviteeContactEmail())) {
|
||||
log.error("joinOrganization() - error: user email = {} doesn't equals invitee email = {}",
|
||||
userEmail, invitationEntity.getInviteeContactEmail());
|
||||
throw new AccessDeniedException(
|
||||
|
@ -1,5 +1,6 @@
|
||||
package dev.vality.orgmanager.util;
|
||||
|
||||
import dev.vality.orgmanager.TestObjectFactory;
|
||||
import dev.vality.orgmanager.entity.InvitationEntity;
|
||||
import dev.vality.orgmanager.entity.MemberEntity;
|
||||
import dev.vality.orgmanager.entity.MemberRoleEntity;
|
||||
@ -35,7 +36,7 @@ public class TestData {
|
||||
.createdAt(LocalDateTime.now())
|
||||
.name("name")
|
||||
.owner("owner")
|
||||
.party("party")
|
||||
.party(TestObjectFactory.randomString())
|
||||
.members(Set.of(member))
|
||||
.build();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user