Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed missing/erroneous backend security. #133

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,19 @@ protected void configure(HttpSecurity http) throws Exception {
.and()
.cors(Customizer.withDefaults())
.authorizeRequests()
.mvcMatchers(HttpMethod.GET, "/docs/**").permitAll()
.mvcMatchers(HttpMethod.GET, "/audit/organizations").hasRole("AuditReporting")
.mvcMatchers(HttpMethod.GET, "/docs/**").permitAll()
.mvcMatchers(HttpMethod.GET, "/audit/organizations").hasRole("AuditReporting")
.mvcMatchers(HttpMethod.POST, "/audit/audit-report").hasRole("AuditReporting")
.mvcMatchers(HttpMethod.GET, "/bulletins").fullyAuthenticated()
.mvcMatchers(HttpMethod.POST, "/patient-registration/get-patient-registration").hasRole("PatientRegistration")
.mvcMatchers(HttpMethod.POST, "/audit/download-report").hasRole("AuditReporting")
.mvcMatchers(HttpMethod.GET, "/bulletins").fullyAuthenticated()
.mvcMatchers(HttpMethod.POST, "/eligibility/check-msp-coverage-status").hasRole("MSPCoverageCheck")
.mvcMatchers(HttpMethod.POST, "/eligibility/check-eligibility").hasRole("CheckEligibility")
.mvcMatchers(HttpMethod.POST, "/eligibility/inquire-phn").hasRole("PHNInquiry")
.mvcMatchers(HttpMethod.POST, "/eligibility/lookup-phn").hasRole("PHNLookup")
.mvcMatchers(HttpMethod.POST, "/maintenance/change-cancel-date").hasRole("ChangeCancelDate")
.mvcMatchers(HttpMethod.POST, "/maintenance/change-effective-date").hasRole("ChangeEffectiveDate")
.mvcMatchers(HttpMethod.POST, "/maintenance/renew-cancelled-group-coverage").hasRole("RenewCancelledCoverage")
.mvcMatchers(HttpMethod.POST, "/maintenance/reinstate-over-age-dependent").hasRole("ReinstateOverAgeDependent")
.mvcMatchers(HttpMethod.POST, "/enrollment/enroll-subscriber").hasAnyRole("AddPermitHolderWithPHN", "AddPermitHolderWOPHN")
.mvcMatchers(HttpMethod.POST, "/enrollment/get-person-details").hasRole("AddPermitHolderWithPHN")
.mvcMatchers(HttpMethod.POST, "/enrollment/name-search").hasRole("AddPermitHolderWOPHN")
Expand All @@ -75,13 +77,13 @@ protected void configure(HttpSecurity http) throws Exception {
.mvcMatchers(HttpMethod.POST, "/group-member/cancel-dependent").hasRole("CancelDependent")
.mvcMatchers(HttpMethod.POST, "/group-member/cancel-group-member").hasRole("CancelGroupMember")
.mvcMatchers(HttpMethod.POST, "/group-member/update-number-and-dept").hasRole("UpdateNumberAndDept")
.mvcMatchers(HttpMethod.POST, "/group-member/reinstate-over-age-dependent").hasRole("ReinstateOverAgeDependent")
.mvcMatchers(HttpMethod.POST, "/msp-contracts/get-contract-periods").hasRole("GetContractPeriods")
.mvcMatchers(HttpMethod.POST, "/msp-contracts/update-contract-address").hasRole("UpdateContractAddress")
.mvcMatchers(HttpMethod.POST, "/msp-contracts/inquire-contract").hasAnyRole("ContractInquiry", "GetGroupMembersContractAddress") //inquire-contract endpoint will require this multi role as it is used by both R40 and R37 transactions
.mvcMatchers(HttpMethod.GET, "/payee-mapping/").hasAnyRole("PatientRegistration", "ManageMSPPayeeNumber")
.mvcMatchers(HttpMethod.POST, "/patient-registration/get-patient-registration").hasRole("PatientRegistration")
.mvcMatchers(HttpMethod.GET, "/payee-mapping/").hasAnyRole("PatientRegistration", "ManageMSPPayeeNumber")
.mvcMatchers(HttpMethod.POST, "/payee-mapping").hasRole("ManageMSPPayeeNumber")
.mvcMatchers(HttpMethod.PUT, "/payee-mapping/").hasRole("ManageMSPPayeeNumber")
.mvcMatchers(HttpMethod.PUT, "/payee-mapping/").hasRole("ManageMSPPayeeNumber")
.mvcMatchers(HttpMethod.DELETE, "/payee-mapping/").hasRole("ManageMSPPayeeNumber")
.mvcMatchers(HttpMethod.GET, "/user/**").fullyAuthenticated()
.mvcMatchers("/*").denyAll()
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/services/BaseService.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import keycloak from '../keycloak'
export const resources = {
bulletins: '/bulletins',
enrollment: {
nameSearch: 'enrollment/name-search',
getPersonDetails: 'enrollment/get-person-details',
nameSearch: '/enrollment/name-search',
getPersonDetails: '/enrollment/get-person-details',
enrollSubscriber: '/enrollment/enroll-subscriber',
},
eligibility: {
Expand All @@ -19,7 +19,7 @@ export const resources = {
getPatientRegistration: '/patient-registration/get-patient-registration',
},
bcscPayeeMappings: {
getBcscPayeeMapping: '/payee-mapping'
getBcscPayeeMapping: '/payee-mapping',
},
groupMember: {
addGroupMember: '/group-member/add-group-member',
Expand Down