Skip to content

Commit

Permalink
Merge pull request #15 from virtualidentityag/CARITAS-243-remove-lega…
Browse files Browse the repository at this point in the history
…cy-code

Caritas 243 remove legacy code
  • Loading branch information
Leandro13Silva13 authored Sep 11, 2024
2 parents ead571a + daf08f1 commit e037e60
Show file tree
Hide file tree
Showing 106 changed files with 619 additions and 4,552 deletions.
79 changes: 2 additions & 77 deletions api/userservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ paths:
get:
tags:
- user-controller
summary: 'Returns sessions for given RocketChat group or feedback group IDs.
summary: 'Returns sessions for given RocketChat group IDs.
[Authorization: Role: user, consultant]'
operationId: getSessionsForGroupOrFeedbackGroupIds
operationId: getSessionsForGroupIds
parameters:
- name: RCToken
in: header
Expand Down Expand Up @@ -877,33 +877,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/mails/reassignment:
post:
tags:
Expand Down Expand Up @@ -2058,13 +2031,6 @@ components:
type: string
example: xGklslk2JJKK
description: Rocket.Chat room ID
feedbackGroupId:
type: string
example: 8ertjlasdKJA
description: Rocket.Chat feedback room ID
isPeerChat:
type: boolean
example: false
askerRcId:
type: string
example: 8ertjlasdKJA
Expand All @@ -2082,9 +2048,6 @@ components:
messagesRead:
type: boolean
example: false
feedbackRead:
type: boolean
example: true
isTeamSession:
type: boolean
example: false
Expand Down Expand Up @@ -2137,45 +2100,13 @@ components:
AliasMessageDTO:
type: object
properties:
forwardMessageDTO:
$ref: '#/components/schemas/ForwardMessageDTO'
videoCallMessageDTO:
$ref: '#/components/schemas/VideoCallMessageDTO'
messageType:
$ref: '#/components/schemas/MessageType'
content:
type: string

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"
displayName:
type: string
rcUserId:
type: string
example: "ag89h3tjkerg94t"
t:
type: string
org:
type: string
example: "Lorem ipsum dolor sit amet, consetetur..."
description: "Legacy fallback for stringified messages"

VideoCallMessageDTO:
type: object
required:
Expand Down Expand Up @@ -2204,7 +2135,6 @@ components:
- "APPOINTMENT_RESCHEDULED"
- "FURTHER_STEPS"
- "UPDATE_SESSION_DATA"
- "FORWARD"
- "VIDEOCALL"
- "FINISHED_CONVERSATION"
- "USER_MUTED"
Expand Down Expand Up @@ -2248,10 +2178,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
Expand Down Expand Up @@ -3117,7 +3043,6 @@ components:
enum:
- DAILY_ENQUIRY
- NEW_CHAT_MESSAGE_FROM_ADVICE_SEEKER
- NEW_FEEDBACK_MESSAGE_FROM_ADVICE_SEEKER

securitySchemes:
Bearer:
Expand Down
9 changes: 0 additions & 9 deletions services/consultingtypeservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,6 @@ components:
lockedAgencies:
type: boolean
example: false
excludeNonMainConsultantsFromTeamSessions:
type: boolean
example: true
whiteSpot:
allOf:
- $ref: '#/components/schemas/WhiteSpotDTO'
Expand All @@ -225,12 +222,6 @@ components:
sessionDataInitializing:
allOf:
- $ref: '#/components/schemas/SessionDataInitializingDTO'
initializeFeedbackChat:
type: boolean
example: true
isPeerChat:
type: boolean
example: true
roles:
$ref: '#/components/schemas/RolesDTO'
notifications:
Expand Down
128 changes: 0 additions & 128 deletions services/messageservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -209,54 +161,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:
Expand Down Expand Up @@ -522,44 +426,13 @@ components:
AliasMessageDTO:
type: object
properties:
forwardMessageDTO:
$ref: '#/components/schemas/ForwardMessageDTO'
videoCallMessageDTO:
$ref: '#/components/schemas/VideoCallMessageDTO'
messageType:
$ref: '#/components/schemas/MessageType'
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..."
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:
Expand Down Expand Up @@ -592,7 +465,6 @@ components:
type: string
enum:
- "FINISHED_CONVERSATION"
- "FORWARD"
- "FURTHER_STEPS"
- "UPDATE_SESSION_DATA"
- "VIDEOCALL"
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/de/caritas/cob/userservice/api/IdentityManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
@RequiredArgsConstructor
public class IdentityManager implements IdentityManaging {

private static final String VIEW_ALL_PEER_SESSIONS = "AUTHORIZATION_VIEW_ALL_PEER_SESSIONS";
private static final String VIEW_ALL_FEEDBACK_SESSIONS =
"AUTHORIZATION_VIEW_ALL_FEEDBACK_SESSIONS";

private final IdentityClient identityClient;

@Override
Expand Down Expand Up @@ -74,14 +70,4 @@ public boolean isEmailAvailableOrOwn(String username, String email) {
|| user.get("encodedUsername").equals(username)
|| user.get("decodedUsername").equals(username);
}

@Override
public boolean canViewPeerSessions(String consultantId) {
return identityClient.userHasAuthority(consultantId, VIEW_ALL_PEER_SESSIONS);
}

@Override
public boolean canViewFeedbackSessions(String consultantId) {
return identityClient.userHasAuthority(consultantId, VIEW_ALL_FEEDBACK_SESSIONS);
}
}
Loading

0 comments on commit e037e60

Please sign in to comment.