diff --git a/services/messageservice.yaml b/services/messageservice.yaml index e9fa3ca..1038fad 100644 --- a/services/messageservice.yaml +++ b/services/messageservice.yaml @@ -82,54 +82,6 @@ paths: - Bearer: [ ] x-codegen-request-body-name: Message - /messages/feedback/new: - post: - tags: - - message-controller - summary: 'Add new Rocket.Chat message to feedback chat [Authorization: authority - for feedback chat]' - operationId: createFeedbackMessage - parameters: - - name: rcToken - in: header - required: true - schema: - type: string - - name: rcUserId - in: header - required: true - schema: - type: string - - name: rcFeedbackGroupId - in: header - required: true - schema: - type: string - requestBody: - content: - 'application/json': - schema: - $ref: '#/components/schemas/MessageDTO' - required: true - responses: - 201: - description: CREATED - message was successfully created - content: - 'application/json': - schema: - $ref: '#/components/schemas/MessageResponseDTO' - 400: - description: BAD REQUEST - invalid/incomplete request or body object - 401: - description: UNAUTHORIZED - no/invalid Keycloak token - 403: - description: FORBIDDEN - no/invalid role/authorization - 500: - description: INTERNAL SERVER ERROR - server encountered unexpected condition - security: - - Bearer: [ ] - x-codegen-request-body-name: Message - /messages/videohint/new: post: tags: @@ -323,54 +275,6 @@ paths: security: - Bearer: [ ] - /messages/forward: - post: - tags: - - message-controller - summary: 'Forward a Rocket.Chat message to another group [Authorization: Role: - u25-consultant]' - operationId: forwardMessage - parameters: - - name: rcToken - in: header - required: true - schema: - type: string - - name: rcUserId - in: header - required: true - schema: - type: string - - name: rcGroupId - in: header - required: true - schema: - type: string - requestBody: - description: Body description - content: - 'application/json': - schema: - $ref: '#/components/schemas/ForwardMessageDTO' - required: true - responses: - 201: - description: CREATED - message was successfully created - content: - 'application/json': - schema: - $ref: '#/components/schemas/MessageResponseDTO' - 400: - description: BAD REQUEST - invalid/incomplete request or body object - 401: - description: UNAUTHORIZED - no/invalid Keycloak token - 403: - description: FORBIDDEN - no/invalid role/authorization - 500: - description: INTERNAL SERVER ERROR - server encountered unexpected condition - security: - - Bearer: [ ] - /messages/draft: post: tags: @@ -627,8 +531,6 @@ components: AliasMessageDTO: type: object properties: - forwardMessageDTO: - $ref: '#/components/schemas/ForwardMessageDTO' videoCallMessageDTO: $ref: '#/components/schemas/VideoCallMessageDTO' messageType: @@ -636,36 +538,6 @@ components: content: type: string - ForwardMessageDTO: - type: object - required: - - message - - timestamp - - username - - rcUserId - properties: - message: - type: string - example: "Lorem ipsum dolor sit amet, consetetur..." - org: - type: string - example: "Lorem ipsum dolor sit amet, consetetur..." - description: "Legacy fallback for stringified messages" - timestamp: - type: string - description: "Full qualified timestamp" - example: "2018-11-15T09:33:00.057Z" - username: - type: string - example: "asker23" - displayName: - type: string - rcUserId: - type: string - example: "ag89h3tjkerg94t" - t: - type: string - VideoCallMessageDTO: type: object required: @@ -706,7 +578,6 @@ components: - "APPOINTMENT_CANCELLED" - "APPOINTMENT_RESCHEDULED" - "FINISHED_CONVERSATION" - - "FORWARD" - "FURTHER_STEPS" - "UPDATE_SESSION_DATA" - "VIDEOCALL" diff --git a/services/userservice.yaml b/services/userservice.yaml index 726e36e..c853036 100644 --- a/services/userservice.yaml +++ b/services/userservice.yaml @@ -538,33 +538,6 @@ paths: description: INTERNAL SERVER ERROR - server encountered unexpected condition security: - Bearer: [ ] - /users/mails/messages/feedback/new: - post: - tags: - - user-controller - summary: 'Sends a notification e-mail that a new feedback message/answer has - been written [Authorization: Role: consultant with authority for feedback - chat]' - operationId: sendNewFeedbackMessageNotification - requestBody: - content: - 'application/json': - schema: - $ref: '#/components/schemas/NewMessageNotificationDTO' - required: true - responses: - 200: - description: successful operation - 400: - description: BAD REQUEST - invalid/incomplete request or body object - 401: - description: UNAUTHORIZED - invalid token - 409: - description: CONFLICT - no user e-mail address in db given - 500: - description: INTERNAL SERVER ERROR - server encountered unexpected condition - security: - - Bearer: [ ] /users/consultants: get: tags: @@ -1211,10 +1184,6 @@ components: type: string example: xGklslk2JJKK description: Rocket.Chat room ID - feedbackGroupId: - type: string - example: 8ertjlasdKJA - description: Rocket.Chat feedback room ID askerRcId: type: string example: 8ertjlasdKJA @@ -1229,9 +1198,6 @@ components: messagesRead: type: boolean example: false - feedbackRead: - type: boolean - example: true isTeamSession: type: boolean example: false @@ -1262,35 +1228,11 @@ components: AliasMessageDTO: type: object properties: - forwardMessageDTO: - $ref: '#/components/schemas/ForwardMessageDTO' videoCallMessageDTO: $ref: '#/components/schemas/VideoCallMessageDTO' messageType: $ref: '#/components/schemas/MessageType' - ForwardMessageDTO: - type: object - required: - - message - - timestamp - - username - - rcUserId - properties: - message: - type: string - example: "Lorem ipsum dolor sit amet, consetetur..." - timestamp: - type: string - description: "Full qualified timestamp" - example: "2018-11-15T09:33:00.057Z" - username: - type: string - example: "asker23" - rcUserId: - type: string - example: "ag89h3tjkerg94t" - VideoCallMessageDTO: type: object required: @@ -1314,7 +1256,6 @@ components: enum: - "FURTHER_STEPS" - "UPDATE_SESSION_DATA" - - "FORWARD" - "VIDEOCALL" ConsultantSessionDTO: @@ -1343,10 +1284,6 @@ components: type: string example: xGklslk2JJKK description: Rocket.Chat room ID - feedbackGroupId: - type: string - example: 8ertjlasdKJA - description: Rocket.Chat feedback room ID consultantId: type: string example: 926b9777-4eef-443d-925a-4aa534797bd7 diff --git a/src/test/java/de/caritas/cob/videoservice/api/tenant/TechnicalUserTenantResolverTest.java b/src/test/java/de/caritas/cob/videoservice/api/tenant/TechnicalUserTenantResolverTest.java index 88ff38a..51f8ed8 100644 --- a/src/test/java/de/caritas/cob/videoservice/api/tenant/TechnicalUserTenantResolverTest.java +++ b/src/test/java/de/caritas/cob/videoservice/api/tenant/TechnicalUserTenantResolverTest.java @@ -62,7 +62,8 @@ void resolve_should_ResolveTechnicalTenantId_ForTechnicalUserRole() { void resolve_should_NotResolveTenantId_When_NonTechnicalUserRole() { // given givenUserIsAuthenticated(); - when(mockAuthentication.getPrincipal()).thenReturn(buildJwtWithRealmRole("another-role")); + when(mockAuthentication.getPrincipal()) + .thenReturn((Object) buildJwtWithRealmRole("another-role")); var resolved = technicalUserTenantResolver.resolve(authenticatedRequest); // then assertThat(resolved).isEmpty(); @@ -78,7 +79,11 @@ private Jwt buildJwtWithRealmRole(String realmRole) { headers.put("alg", "HS256"); // Signature algorithm headers.put("typ", "JWT"); // Token type return new Jwt( - "token", Instant.now(), Instant.now(), headers, givenClaimMapContainingRole(realmRole)); + "token", + Instant.now(), + Instant.now().plusSeconds(1), + headers, + givenClaimMapContainingRole(realmRole)); } private HashMap givenClaimMapContainingRole(String realmRole) {