├── .github ├── img │ ├── flow_process.jpg │ ├── flow_scans.png │ ├── logo.png │ ├── logo_vertical.png │ ├── vulns.png │ └── webhook.png └── workflows │ ├── docker-build-backend.yml │ └── docker-build-frontend.yml ├── .gitignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── SECURITY.md ├── backend.zip ├── backend ├── Dockerfile ├── HELP.md ├── README.md ├── entrypoint.sh ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── .DS_Store │ ├── main │ ├── .DS_Store │ ├── java │ │ ├── .DS_Store │ │ └── io │ │ │ ├── .DS_Store │ │ │ └── mixeway │ │ │ ├── .DS_Store │ │ │ └── mixewayflowapi │ │ │ ├── .DS_Store │ │ │ ├── MixewayFlowApiApplication.java │ │ │ ├── api │ │ │ ├── admin │ │ │ │ ├── controller │ │ │ │ │ ├── AdminController.java │ │ │ │ │ └── AppConfigController.java │ │ │ │ ├── dto │ │ │ │ │ ├── AdditionalScannerConfigDto.java │ │ │ │ │ ├── ConfigScaRequestDto.java │ │ │ │ │ ├── ConfigSmtpRequestDto.java │ │ │ │ │ ├── ConfigWizRequestDto.java │ │ │ │ │ └── RunModeRequestDto.java │ │ │ │ └── service │ │ │ │ │ └── AdminApiService.java │ │ │ ├── auth │ │ │ │ ├── controller │ │ │ │ │ └── AuthController.java │ │ │ │ ├── dto │ │ │ │ │ ├── AuthRequestDTO.java │ │ │ │ │ ├── JwtResponseDTO.java │ │ │ │ │ ├── PassRequestDTO.java │ │ │ │ │ └── ServiceStatusDTO.java │ │ │ │ └── service │ │ │ │ │ ├── AuthService.java │ │ │ │ │ ├── CustomOAuth2UserService.java │ │ │ │ │ └── GitHubOAuth2UserService.java │ │ │ ├── cicd │ │ │ │ ├── controller │ │ │ │ │ └── CICDController.java │ │ │ │ ├── dto │ │ │ │ │ ├── CodeRepoDto.java │ │ │ │ │ └── ValidateStatusDto.java │ │ │ │ └── service │ │ │ │ │ ├── CICDService.java │ │ │ │ │ └── ValidateStatusMapper.java │ │ │ ├── cloudsubscription │ │ │ │ ├── controller │ │ │ │ │ ├── CloudFindingController.java │ │ │ │ │ ├── CloudStatisticController.java │ │ │ │ │ └── CloudSubscriptionController.java │ │ │ │ ├── dto │ │ │ │ │ ├── CloudSubscriptionDto.java │ │ │ │ │ └── GetCloudSubscriptionsResponseDto.java │ │ │ │ └── service │ │ │ │ │ ├── CloudFindingService.java │ │ │ │ │ ├── CloudStatisticService.java │ │ │ │ │ └── CloudSubscriptionService.java │ │ │ ├── coderepo │ │ │ │ ├── controller │ │ │ │ │ ├── CodeRepoController.java │ │ │ │ │ ├── FindingController.java │ │ │ │ │ └── StatisticController.java │ │ │ │ ├── dto │ │ │ │ │ ├── AggregatedRepoStatsDTO.java │ │ │ │ │ ├── ChangeTeamRequestDto.java │ │ │ │ │ ├── CommentDto.java │ │ │ │ │ ├── CreateCodeRepoRequestDto.java │ │ │ │ │ ├── CreateCommentRequestDto.java │ │ │ │ │ ├── DailyFindings.java │ │ │ │ │ ├── DailyFindingsProjection.java │ │ │ │ │ ├── GetCodeReposResponseDto.java │ │ │ │ │ ├── GetFindingResponseDto.java │ │ │ │ │ ├── VulnStatsResponseDto.java │ │ │ │ │ └── VulnsResponseDto.java │ │ │ │ ├── mapper │ │ │ │ │ └── FindingMapper.java │ │ │ │ └── service │ │ │ │ │ ├── CodeRepoApiService.java │ │ │ │ │ ├── FindingService.java │ │ │ │ │ └── StatisticService.java │ │ │ ├── components │ │ │ │ ├── controller │ │ │ │ │ └── ComponentsController.java │ │ │ │ ├── dto │ │ │ │ │ ├── ComponentDto.java │ │ │ │ │ ├── ComponentProjectionDto.java │ │ │ │ │ ├── ComponentRawDataDto.java │ │ │ │ │ └── GetComponentsResponseDto.java │ │ │ │ └── service │ │ │ │ │ └── ComponentsService.java │ │ │ ├── organization │ │ │ │ ├── controller │ │ │ │ │ └── OrganizationController.java │ │ │ │ ├── dto │ │ │ │ │ ├── OrganizationCreateRequestDto.java │ │ │ │ │ ├── OrganizationDto.java │ │ │ │ │ ├── OrganizationUpdateRequestDto.java │ │ │ │ │ ├── TeamDto.java │ │ │ │ │ └── UserDto.java │ │ │ │ └── service │ │ │ │ │ └── OrganizationApiService.java │ │ │ ├── stats │ │ │ │ └── StatsController.java │ │ │ ├── team │ │ │ │ ├── controller │ │ │ │ │ └── TeamController.java │ │ │ │ ├── dto │ │ │ │ │ ├── ChangeTeamRequestDto.java │ │ │ │ │ ├── CreateTeamRequestDto.java │ │ │ │ │ ├── SimpleUserDto.java │ │ │ │ │ ├── TeamDto.java │ │ │ │ │ └── TeamIdDto.java │ │ │ │ └── service │ │ │ │ │ └── TeamService.java │ │ │ ├── teamfindings │ │ │ │ ├── controller │ │ │ │ │ ├── FindingsByTeamController.java │ │ │ │ │ └── TeamStatisticController.java │ │ │ │ ├── dto │ │ │ │ │ ├── CombinedDailyStatsDto.java │ │ │ │ │ ├── DailyCloudSubscriptionsStatsDto.java │ │ │ │ │ ├── DailyCodeReposStatsDto.java │ │ │ │ │ ├── TeamFindingsAndVulnsResponseDto.java │ │ │ │ │ ├── TeamVulnStatsResponseDto.java │ │ │ │ │ └── TeamVulnsResponseDto.java │ │ │ │ ├── mapper │ │ │ │ │ ├── TeamFindingAndVulnsMapper.java │ │ │ │ │ └── TeamFindingMapper.java │ │ │ │ └── service │ │ │ │ │ ├── FindingsByTeamService.java │ │ │ │ │ └── TeamStatisticService.java │ │ │ ├── threatintel │ │ │ │ ├── controller │ │ │ │ │ ├── SuppressRuleController.java │ │ │ │ │ └── ThreatIntelController.java │ │ │ │ ├── dto │ │ │ │ │ ├── ItemListResponse.java │ │ │ │ │ ├── RemovedVulnerabilityDTO.java │ │ │ │ │ ├── ReviewedVulnerabilityDTO.java │ │ │ │ │ ├── SuppressRuleDTO.java │ │ │ │ │ └── SuppressRuleResponseDTO.java │ │ │ │ └── service │ │ │ │ │ ├── SuppressRuleService.java │ │ │ │ │ └── ThreatIntelService.java │ │ │ ├── user │ │ │ │ ├── controller │ │ │ │ │ └── UserController.java │ │ │ │ ├── dto │ │ │ │ │ ├── AppModeInfoDto.java │ │ │ │ │ ├── ChangePasswordDto.java │ │ │ │ │ ├── ChangeRoleRequestDto.java │ │ │ │ │ ├── ChangeTeamRequestDto.java │ │ │ │ │ ├── CreateUserRequestDto.java │ │ │ │ │ ├── QuotaLimitsDto.java │ │ │ │ │ ├── QuotaUsageDto.java │ │ │ │ │ ├── UserDto.java │ │ │ │ │ └── UserQuotaInfoDto.java │ │ │ │ └── service │ │ │ │ │ └── AppModeInfoService.java │ │ │ ├── vulnerabilities │ │ │ │ ├── controller │ │ │ │ │ └── VulnerabilityController.java │ │ │ │ ├── dto │ │ │ │ │ ├── EditVulnerabilityRequestDto.java │ │ │ │ │ ├── GetVulnerabilitiesResponseDto.java │ │ │ │ │ ├── VulnerabilityDto.java │ │ │ │ │ └── VulnerabilityRawDataDto.java │ │ │ │ └── service │ │ │ │ │ └── VulnerabilityService.java │ │ │ └── webhook │ │ │ │ ├── controller │ │ │ │ ├── GitHubWebhookController.java │ │ │ │ └── GitlabWebhookController.java │ │ │ │ ├── dto │ │ │ │ ├── GHMergeEventDTO.java │ │ │ │ ├── GHPushEventDTO.java │ │ │ │ ├── GLMergeEventDTO.java │ │ │ │ └── GLPushEventDTO.java │ │ │ │ └── service │ │ │ │ ├── GitHubWebhookService.java │ │ │ │ └── GitLabWebhookService.java │ │ │ ├── auth │ │ │ ├── CustomAuthenticationEntryPoint.java │ │ │ ├── CustomUserDetails.java │ │ │ ├── OAuth2LoginSuccessHandler.java │ │ │ ├── UserDetailsServiceImpl.java │ │ │ └── jwt │ │ │ │ ├── JwtAuthFilter.java │ │ │ │ └── JwtService.java │ │ │ ├── config │ │ │ ├── AppConfigService.java │ │ │ ├── BCryptEncoderConfig.java │ │ │ ├── Oauth2SecurityConfig.java │ │ │ ├── SecurityConfig.java │ │ │ ├── WebClientConfig.java │ │ │ └── WebConfig.java │ │ │ ├── db │ │ │ ├── entity │ │ │ │ ├── AppConfig.java │ │ │ │ ├── AppDataType.java │ │ │ │ ├── CloudScanInfo.java │ │ │ │ ├── CloudSubscription.java │ │ │ │ ├── CloudSubscriptionFindingStats.java │ │ │ │ ├── CodeRepo.java │ │ │ │ ├── CodeRepoBranch.java │ │ │ │ ├── CodeRepoFindingStats.java │ │ │ │ ├── Comment.java │ │ │ │ ├── Component.java │ │ │ │ ├── Finding.java │ │ │ │ ├── Organization.java │ │ │ │ ├── PlanLimits.java │ │ │ │ ├── RepositoryAllowlist.java │ │ │ │ ├── ScanInfo.java │ │ │ │ ├── Settings.java │ │ │ │ ├── SuppressRule.java │ │ │ │ ├── Team.java │ │ │ │ ├── UserInfo.java │ │ │ │ ├── UserRole.java │ │ │ │ └── Vulnerability.java │ │ │ ├── projection │ │ │ │ ├── Item.java │ │ │ │ ├── ItemDTO.java │ │ │ │ ├── ItemProjection.java │ │ │ │ ├── Project.java │ │ │ │ ├── RemovedVulnerabilityProjection.java │ │ │ │ └── ReviewedVulnerabilityProjection.java │ │ │ └── repository │ │ │ │ ├── AppConfigRepository.java │ │ │ │ ├── AppDataTypeRepository.java │ │ │ │ ├── CloudScanInfoRepository.java │ │ │ │ ├── CloudSubscriptionFindingStatsRepository.java │ │ │ │ ├── CloudSubscriptionRepository.java │ │ │ │ ├── CodeRepoBranchRepository.java │ │ │ │ ├── CodeRepoFindingStatsRepository.java │ │ │ │ ├── CodeRepoRepository.java │ │ │ │ ├── CommentRepository.java │ │ │ │ ├── ComponentRepository.java │ │ │ │ ├── FindingRepository.java │ │ │ │ ├── OrganizationRepository.java │ │ │ │ ├── PlanLimitsRepository.java │ │ │ │ ├── RepositoryAllowlistRepository.java │ │ │ │ ├── ScanInfoRepository.java │ │ │ │ ├── SettingsRepository.java │ │ │ │ ├── SuppressRuleRepository.java │ │ │ │ ├── TeamRepository.java │ │ │ │ ├── UserRepository.java │ │ │ │ ├── UserRoleRepository.java │ │ │ │ └── VulnerabilityRepository.java │ │ │ ├── domain │ │ │ ├── .DS_Store │ │ │ ├── appdatatype │ │ │ │ └── CreateAppDataTypeService.java │ │ │ ├── cloudscaninfo │ │ │ │ └── CreateCloudScanInfoService.java │ │ │ ├── cloudsubscription │ │ │ │ ├── CreateCloudSubscriptionService.java │ │ │ │ ├── DeleteCloudSubscriptionService.java │ │ │ │ ├── FindCloudSubscriptionService.java │ │ │ │ └── UpdateCloudSubscriptionService.java │ │ │ ├── cloudsubscriptionfindingstats │ │ │ │ ├── CreateCloudSubscriptionFindingStatsService.java │ │ │ │ └── FindCloudSubscriptionFindingStatsService.java │ │ │ ├── coderepo │ │ │ │ ├── CreateCodeRepoService.java │ │ │ │ ├── FindCodeRepoService.java │ │ │ │ └── UpdateCodeRepoService.java │ │ │ ├── coderepobranch │ │ │ │ ├── FindCodeRepoBranchService.java │ │ │ │ └── GetOrCreateCodeRepoBranchService.java │ │ │ ├── coderepofindingstats │ │ │ │ ├── CreateCodeRepoFindingStatsService.java │ │ │ │ └── FindCodeRepoFindingStatsService.java │ │ │ ├── comment │ │ │ │ └── CreateCommentService.java │ │ │ ├── component │ │ │ │ ├── FindComponentService.java │ │ │ │ └── GetOrCreateComponentService.java │ │ │ ├── dtrack │ │ │ │ └── ProcessDTrackVulnDataService.java │ │ │ ├── finding │ │ │ │ ├── CreateFindingService.java │ │ │ │ ├── FindFindingService.java │ │ │ │ └── UpdateFindingService.java │ │ │ ├── onboarding │ │ │ │ └── OnboardingService.java │ │ │ ├── organization │ │ │ │ └── OrganizationService.java │ │ │ ├── repositoryallowlist │ │ │ │ └── FindRepositoryAllowlistService.java │ │ │ ├── roles │ │ │ │ └── FindRoleService.java │ │ │ ├── scaninfo │ │ │ │ ├── CreateScanInfoService.java │ │ │ │ └── FindScanInfoService.java │ │ │ ├── settings │ │ │ │ ├── FindSettingsService.java │ │ │ │ └── UpdateSettingsService.java │ │ │ ├── suppressrule │ │ │ │ ├── CheckSuppressRuleService.java │ │ │ │ ├── CreateSuppressRuleService.java │ │ │ │ ├── DeleteSuppressRuleService.java │ │ │ │ └── FindSuppressRuleService.java │ │ │ ├── team │ │ │ │ ├── ChangeTeamService.java │ │ │ │ ├── CreateTeamService.java │ │ │ │ ├── DeleteTeamService.java │ │ │ │ └── FindTeamService.java │ │ │ ├── user │ │ │ │ ├── CreateUserService.java │ │ │ │ ├── FindUserService.java │ │ │ │ └── UpdateUserService.java │ │ │ └── vulnerability │ │ │ │ ├── FindVulnerabilityService.java │ │ │ │ ├── GetOrCreateVulnerabilityService.java │ │ │ │ └── UpdateVulnerabilityService.java │ │ │ ├── exceptions │ │ │ ├── CloudSubscriptionNotFoundException.java │ │ │ ├── CodeRepoNotFoundException.java │ │ │ ├── ComponentException.java │ │ │ ├── DuplicateCloudSubscriptionException.java │ │ │ ├── FindingNotFoundException.java │ │ │ ├── GitException.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ ├── QuotaExceededException.java │ │ │ ├── RoleNotExistingException.java │ │ │ ├── ScanException.java │ │ │ ├── SettingsException.java │ │ │ ├── TeamAlreadyExistsException.java │ │ │ ├── TeamHasResourcesException.java │ │ │ ├── TeamNotFoundException.java │ │ │ ├── UnauthorizedAccessException.java │ │ │ ├── UnauthorizedException.java │ │ │ ├── UserAlreadyExistsException.java │ │ │ ├── UserNotExistingException.java │ │ │ └── VulnerabilityException.java │ │ │ ├── integrations │ │ │ ├── repo │ │ │ │ ├── apiclient │ │ │ │ │ ├── GitHubApiClientService.java │ │ │ │ │ └── GitLabApiClientService.java │ │ │ │ ├── dto │ │ │ │ │ ├── CommentMessage.java │ │ │ │ │ ├── ImportCodeRepoGitHubResponseDto.java │ │ │ │ │ └── ImportCodeRepoResponseDto.java │ │ │ │ └── service │ │ │ │ │ ├── GetCodeRepoInfoService.java │ │ │ │ │ ├── GitCommentService.java │ │ │ │ │ └── GitService.java │ │ │ └── scanner │ │ │ │ ├── cloud_scanner │ │ │ │ ├── dto │ │ │ │ │ ├── CloudScannerReport.java │ │ │ │ │ └── ProjectExternalNameResponse.java │ │ │ │ └── service │ │ │ │ │ ├── CloudScannerService.java │ │ │ │ │ └── FetchProjectExternalName.java │ │ │ │ ├── gitlab_scanner │ │ │ │ ├── rules │ │ │ │ │ └── GitLabRules.java │ │ │ │ └── service │ │ │ │ │ └── GitLabScannerService.java │ │ │ │ ├── iac │ │ │ │ ├── dto │ │ │ │ │ └── KicsReport.java │ │ │ │ └── service │ │ │ │ │ └── IaCService.java │ │ │ │ ├── sast │ │ │ │ ├── dto │ │ │ │ │ ├── BearerScanDataflow.java │ │ │ │ │ ├── BearerScanSecurity.java │ │ │ │ │ ├── CodeLocation.java │ │ │ │ │ ├── Column.java │ │ │ │ │ └── Item.java │ │ │ │ └── service │ │ │ │ │ └── SASTService.java │ │ │ │ ├── sca │ │ │ │ ├── apiclient │ │ │ │ │ ├── DependencyTrackApiClientService.java │ │ │ │ │ └── KEVApiClient.java │ │ │ │ ├── dto │ │ │ │ │ ├── CatalogDto.java │ │ │ │ │ ├── CreateProjectRequestDto.java │ │ │ │ │ ├── CreateProjectResponseDto.java │ │ │ │ │ ├── DTrackGetVulnResponseDto.java │ │ │ │ │ ├── GetApiKeyResponseDto.java │ │ │ │ │ ├── SendBomRequestDto.java │ │ │ │ │ └── VulnerabilityDto.java │ │ │ │ └── service │ │ │ │ │ ├── CdxGenService.java │ │ │ │ │ └── SCAService.java │ │ │ │ └── secrets │ │ │ │ ├── dto │ │ │ │ └── Secret.java │ │ │ │ └── service │ │ │ │ └── SecretsService.java │ │ │ ├── scanmanager │ │ │ ├── scheduler │ │ │ │ ├── ScanScheduler.java │ │ │ │ └── StatsScheduler.java │ │ │ └── service │ │ │ │ └── ScanManagerService.java │ │ │ └── utils │ │ │ ├── Constants.java │ │ │ ├── DTO.java │ │ │ ├── DtoValidator.java │ │ │ ├── PermissionFactory.java │ │ │ ├── PlanManagementService.java │ │ │ ├── Role.java │ │ │ └── StatusDTO.java │ └── resources │ │ ├── application-dev.properties │ │ ├── application-devsso.properties │ │ ├── application-prod.properties │ │ ├── application-prodsso.properties │ │ ├── application-saas.properties │ │ ├── application-ut.properties │ │ ├── db │ │ └── changelog │ │ │ ├── data_dump_test.sql │ │ │ ├── db.changelog-master.sql │ │ │ └── test.changelog.yaml │ │ └── gitlab_rules │ │ └── rules.json │ └── test │ └── java │ └── io │ └── mixeway │ └── mixewayflowapi │ ├── api │ └── cicd │ │ └── service │ │ └── CICDServiceTest.java │ ├── config │ └── TestConfig.java │ └── domain │ ├── appdatatype │ └── CreateAppDataTypeServiceTest.java │ ├── cloudsubscription │ └── CloudSubscriptionDomainServicesTest.java │ ├── coderepo │ ├── CreateCodeRepoServiceTest.java │ ├── FindCodeRepoServiceTest.java │ └── UpdateCodeRepoServiceTest.java │ ├── coderepobranch │ ├── FindCodeRepoBranchServiceTest.java │ └── GetOrCreateCodeRepoBranchServiceTest.java │ ├── coderepofindingstats │ ├── CreateCodeRepoFindingStatsServiceTest.java │ └── FindCodeRepoFindingStatsServiceTest.java │ ├── comment │ └── CreateCommentServiceTest.java │ ├── component │ ├── FindComponentServiceTest.java │ └── GetOrCreateComponentServiceTest.java │ ├── dtrack │ └── ProcessDTrackVulnDataServiceTest.java │ ├── finding │ ├── CreateFindingServiceTest.java │ ├── FindFindingServiceTest.java │ └── UpdateFindingServiceTest.java │ ├── roles │ └── FindRoleServiceTest.java │ ├── scaninfo │ └── CreateScanInfoServiceTest.java │ ├── settings │ ├── FindSettingsServiceTest.java │ └── UpdateSettingsServiceTest.java │ ├── suppressrule │ └── CreateSuppressRuleServiceTest.java │ ├── team │ ├── ChangeTeamServiceTest.java │ ├── CreateTeamServiceTest.java │ └── FindTeamServiceTest.java │ ├── user │ ├── CreateUserServiceTest.java │ ├── FindUserServiceTest.java │ └── UpdateUserServiceTest.java │ └── vulnerability │ ├── FindVulnerabilityServiceTest.java │ ├── GetOrCreateVulnerabilityServiceTest.java │ └── UpdateVulnerabilityServiceTest.java ├── dev ├── Dockerfile └── nginx-dev.conf ├── docker-compose.yml └── frontend ├── Dockerfile ├── README.md ├── angular.json ├── entrypoint.sh ├── frontend.iml ├── karma.conf.js ├── nginx ├── nginx.conf └── proxy.conf.json ├── package-lock.json ├── package.json ├── src ├── app │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.config.ts │ ├── app.routes.ts │ ├── icons │ │ ├── icon-subset.ts │ │ ├── logo.ts │ │ └── signet.ts │ ├── layout │ │ ├── default-layout │ │ │ ├── _nav.ts │ │ │ ├── default-footer │ │ │ │ ├── default-footer.component.html │ │ │ │ ├── default-footer.component.scss │ │ │ │ ├── default-footer.component.spec.ts │ │ │ │ └── default-footer.component.ts │ │ │ ├── default-header │ │ │ │ ├── default-header.component.html │ │ │ │ ├── default-header.component.scss │ │ │ │ ├── default-header.component.spec.ts │ │ │ │ └── default-header.component.ts │ │ │ ├── default-layout.component.html │ │ │ ├── default-layout.component.scss │ │ │ ├── default-layout.component.ts │ │ │ └── index.ts │ │ └── index.ts │ ├── model │ │ ├── FindingDTO.ts │ │ ├── FindingSourceStatDTO.ts │ │ ├── Models.ts │ │ ├── TeamFindingSourceStatDTO.ts │ │ └── stats.models.ts │ ├── service │ │ ├── AppConfigService.ts │ │ ├── AuthService.ts │ │ ├── CloudService.ts │ │ ├── CloudSubscriptionService.ts │ │ ├── ComponentsService.ts │ │ ├── DashboardService.ts │ │ ├── GitHubService.ts │ │ ├── GitLabService.ts │ │ ├── OrganizationService.ts │ │ ├── RepoService.ts │ │ ├── SettingsService.ts │ │ ├── StatsService.ts │ │ ├── TeamFindingsService.ts │ │ ├── TeamService.ts │ │ ├── ThreatIntelService.ts │ │ ├── UserService.ts │ │ └── VulnerabilityService.ts │ ├── utils │ │ └── GitRepoUrlValidator.ts │ └── views │ │ ├── admin-settings │ │ ├── admin-settings.component.html │ │ ├── admin-settings.component.scss │ │ ├── admin-settings.component.spec.ts │ │ ├── admin-settings.component.ts │ │ └── routes.ts │ │ ├── admin-users │ │ ├── admin-users.component.html │ │ ├── admin-users.component.scss │ │ ├── admin-users.component.spec.ts │ │ ├── admin-users.component.ts │ │ └── routes.ts │ │ ├── components │ │ ├── components.component.html │ │ ├── components.component.scss │ │ ├── components.component.spec.ts │ │ ├── components.component.ts │ │ └── routes.ts │ │ ├── dashboard │ │ ├── dashboard-charts-data.ts │ │ ├── dashboard.component.html │ │ ├── dashboard.component.scss │ │ ├── dashboard.component.ts │ │ └── routes.ts │ │ ├── manage-teams │ │ ├── manage-teams.component.html │ │ ├── manage-teams.component.scss │ │ ├── manage-teams.component.spec.ts │ │ ├── manage-teams.component.ts │ │ └── routes.ts │ │ ├── pages │ │ ├── change-password │ │ │ ├── change-password.component.html │ │ │ ├── change-password.component.scss │ │ │ ├── change-password.component.spec.ts │ │ │ └── change-password.component.ts │ │ ├── login │ │ │ ├── login.component.html │ │ │ ├── login.component.scss │ │ │ ├── login.component.spec.ts │ │ │ └── login.component.ts │ │ ├── page404 │ │ │ ├── page404.component.html │ │ │ ├── page404.component.scss │ │ │ ├── page404.component.spec.ts │ │ │ └── page404.component.ts │ │ ├── page500 │ │ │ ├── page500.component.html │ │ │ ├── page500.component.scss │ │ │ ├── page500.component.spec.ts │ │ │ └── page500.component.ts │ │ ├── register │ │ │ ├── register.component.html │ │ │ ├── register.component.scss │ │ │ ├── register.component.spec.ts │ │ │ └── register.component.ts │ │ └── routes.ts │ │ ├── security-dashboard │ │ ├── routes.ts │ │ ├── security-dashboard.component.html │ │ ├── security-dashboard.component.scss │ │ ├── security-dashboard.component.spec.ts │ │ └── security-dashboard.component.ts │ │ ├── show-cloud-subscription │ │ ├── cloud-subscription-info │ │ │ ├── cloud-subscription-info.component.html │ │ │ ├── cloud-subscription-info.component.scss │ │ │ ├── cloud-subscription-info.component.spec.ts │ │ │ └── cloud-subscription-info.component.ts │ │ ├── cloud-vulnerabilities-table │ │ │ ├── cloud-vulnerabilities-table.component.html │ │ │ ├── cloud-vulnerabilities-table.component.scss │ │ │ ├── cloud-vulnerabilities-table.component.spec.ts │ │ │ └── cloud-vulnerabilities-table.component.ts │ │ ├── cloud-vulnerability-details │ │ │ ├── cloud-vulnerability-details.component.html │ │ │ ├── cloud-vulnerability-details.component.scss │ │ │ ├── cloud-vulnerability-details.component.spec.ts │ │ │ └── cloud-vulnerability-details.component.ts │ │ ├── cloud-vulnerability-summary │ │ │ ├── cloud-vulnerability-summary.component.html │ │ │ ├── cloud-vulnerability-summary.component.scss │ │ │ ├── cloud-vulnerability-summary.component.spec.ts │ │ │ └── cloud-vulnerability-summary.component.ts │ │ ├── routes.ts │ │ ├── show-cloud-subscription.component.html │ │ ├── show-cloud-subscription.component.scss │ │ ├── show-cloud-subscription.component.spec.ts │ │ └── show-cloud-subscription.component.ts │ │ ├── show-repo │ │ ├── repository-info │ │ │ ├── repository-info.component.html │ │ │ ├── repository-info.component.scss │ │ │ ├── repository-info.component.spec.ts │ │ │ └── repository-info.component.ts │ │ ├── routes.ts │ │ ├── show-repo.component.html │ │ ├── show-repo.component.scss │ │ ├── show-repo.component.spec.ts │ │ ├── show-repo.component.ts │ │ ├── vulnerabilities-table │ │ │ ├── vulnerabilities-table.component.html │ │ │ ├── vulnerabilities-table.component.scss │ │ │ ├── vulnerabilities-table.component.spec.ts │ │ │ └── vulnerabilities-table.component.ts │ │ ├── vulnerability-details │ │ │ ├── vulnerability-details.component.html │ │ │ ├── vulnerability-details.component.scss │ │ │ ├── vulnerability-details.component.spec.ts │ │ │ └── vulnerability-details.component.ts │ │ └── vulnerability-summary │ │ │ ├── vulnerability-summary.component.html │ │ │ ├── vulnerability-summary.component.scss │ │ │ ├── vulnerability-summary.component.spec.ts │ │ │ └── vulnerability-summary.component.ts │ │ ├── show-team │ │ ├── routes.ts │ │ ├── show-team.component.html │ │ ├── show-team.component.scss │ │ ├── show-team.component.spec.ts │ │ ├── show-team.component.ts │ │ ├── team-info │ │ │ ├── team-info.component.html │ │ │ ├── team-info.component.scss │ │ │ ├── team-info.component.spec.ts │ │ │ └── team-info.component.ts │ │ ├── team-scan-info │ │ │ ├── team-scan-info.component.html │ │ │ ├── team-scan-info.component.scss │ │ │ ├── team-scan-info.component.spec.ts │ │ │ └── team-scan-info.component.ts │ │ ├── team-statistics-chart │ │ │ ├── team-statistics-chart.component.html │ │ │ ├── team-statistics-chart.component.scss │ │ │ ├── team-statistics-chart.component.spec.ts │ │ │ └── team-statistics-chart.component.ts │ │ ├── team-vulnerabilities-table │ │ │ ├── team-vulnerabilities-table.component.html │ │ │ ├── team-vulnerabilities-table.component.scss │ │ │ ├── team-vulnerabilities-table.component.spec.ts │ │ │ └── team-vulnerabilities-table.component.ts │ │ ├── team-vulnerability-details │ │ │ ├── team-vulnerability-details.component.html │ │ │ ├── team-vulnerability-details.component.scss │ │ │ ├── team-vulnerability-details.component.spec.ts │ │ │ └── team-vulnerability-details.component.ts │ │ └── team-vulnerability-summary │ │ │ ├── team-vulnerability-summary.component.html │ │ │ ├── team-vulnerability-summary.component.scss │ │ │ ├── team-vulnerability-summary.component.spec.ts │ │ │ └── team-vulnerability-summary.component.ts │ │ ├── threat-intel │ │ ├── infos │ │ │ ├── infos.component.html │ │ │ ├── infos.component.scss │ │ │ ├── infos.component.spec.ts │ │ │ └── infos.component.ts │ │ ├── reviews │ │ │ ├── reviews.component.html │ │ │ ├── reviews.component.scss │ │ │ ├── reviews.component.spec.ts │ │ │ └── reviews.component.ts │ │ ├── routes.ts │ │ ├── threat-intel.component.html │ │ ├── threat-intel.component.scss │ │ ├── threat-intel.component.spec.ts │ │ ├── threat-intel.component.ts │ │ ├── threat-list │ │ │ ├── threat-list.component.html │ │ │ ├── threat-list.component.scss │ │ │ ├── threat-list.component.spec.ts │ │ │ └── threat-list.component.ts │ │ ├── threat-score │ │ │ ├── threat-score.component.html │ │ │ ├── threat-score.component.scss │ │ │ ├── threat-score.component.spec.ts │ │ │ └── threat-score.component.ts │ │ └── waivers │ │ │ ├── waivers.component.html │ │ │ ├── waivers.component.scss │ │ │ ├── waivers.component.spec.ts │ │ │ └── waivers.component.ts │ │ ├── vulnerabilities │ │ ├── routes.ts │ │ ├── vulnerabilities.component.html │ │ ├── vulnerabilities.component.scss │ │ ├── vulnerabilities.component.spec.ts │ │ └── vulnerabilities.component.ts │ │ └── widgets │ │ ├── routes.ts │ │ ├── widgets-brand │ │ ├── widgets-brand.component.html │ │ ├── widgets-brand.component.scss │ │ ├── widgets-brand.component.spec.ts │ │ └── widgets-brand.component.ts │ │ ├── widgets-dropdown │ │ ├── widgets-dropdown.component.html │ │ ├── widgets-dropdown.component.scss │ │ ├── widgets-dropdown.component.spec.ts │ │ └── widgets-dropdown.component.ts │ │ ├── widgets-e │ │ ├── widgets-e.component.html │ │ ├── widgets-e.component.scss │ │ ├── widgets-e.component.spec.ts │ │ └── widgets-e.component.ts │ │ └── widgets │ │ ├── widgets.component.html │ │ ├── widgets.component.scss │ │ ├── widgets.component.spec.ts │ │ └── widgets.component.ts ├── assets │ ├── .gitkeep │ ├── angular.ico │ ├── brand │ │ ├── coreui-angular-white.svg │ │ ├── coreui-angular.svg │ │ ├── coreui-base-white.svg │ │ ├── coreui-base.svg │ │ ├── coreui-signet-white.svg │ │ └── coreui-signet.svg │ ├── favicon.ico │ └── images │ │ ├── angular.jpg │ │ ├── avatars │ │ └── 8.png │ │ ├── flow_logo.jpg │ │ ├── flow_logo_text.png │ │ ├── flow_logo_text_transparent.png │ │ ├── flow_logo_transparent.png │ │ ├── logo_32.png │ │ ├── logo_fill_text.png │ │ ├── logo_no_text.png │ │ ├── logo_text.png │ │ ├── logo_vertical.png │ │ ├── logo_vertical_32.png │ │ ├── logo_vertical_fill-32.png │ │ ├── logo_vertical_fill.png │ │ ├── react.jpg │ │ └── vue.jpg ├── components │ ├── docs-callout │ │ ├── docs-callout.component.html │ │ ├── docs-callout.component.scss │ │ ├── docs-callout.component.spec.ts │ │ └── docs-callout.component.ts │ ├── docs-example │ │ ├── docs-example.component.html │ │ ├── docs-example.component.scss │ │ ├── docs-example.component.spec.ts │ │ └── docs-example.component.ts │ ├── docs-link │ │ ├── docs-link.component.html │ │ ├── docs-link.component.scss │ │ ├── docs-link.component.spec.ts │ │ └── docs-link.component.ts │ ├── index.ts │ └── public-api.ts ├── declarations.d.ts ├── environments │ ├── environment.dev.ts │ ├── environment.prod.ts │ └── environment.ts ├── index.html ├── main.ts ├── scss │ ├── _charts.scss │ ├── _custom.scss │ ├── _examples.scss │ ├── _fixes.scss │ ├── _scrollbar.scss │ ├── _theme.scss │ ├── _variables.scss │ └── styles.scss └── test.ts ├── tsconfig.app.json ├── tsconfig.json └── tsconfig.spec.json /.github/img/flow_process.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/.github/img/flow_process.jpg -------------------------------------------------------------------------------- /.github/img/flow_scans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/.github/img/flow_scans.png -------------------------------------------------------------------------------- /.github/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/.github/img/logo.png -------------------------------------------------------------------------------- /.github/img/logo_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/.github/img/logo_vertical.png -------------------------------------------------------------------------------- /.github/img/vulns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/.github/img/vulns.png -------------------------------------------------------------------------------- /.github/img/webhook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/.github/img/webhook.png -------------------------------------------------------------------------------- /.github/workflows/docker-build-frontend.yml: -------------------------------------------------------------------------------- 1 | name: Docker Build and Push 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - 'frontend/**' 9 | 10 | jobs: 11 | build-and-push-frontend: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout code 15 | uses: actions/checkout@v3 16 | 17 | - name: Set up Docker Buildx 18 | uses: docker/setup-buildx-action@v2 19 | 20 | - name: Log in to DockerHub 21 | uses: docker/login-action@v2 22 | with: 23 | username: ${{ secrets.DOCKERHUB_USERNAME }} 24 | password: ${{ secrets.DOCKERHUB_TOKEN }} 25 | 26 | - name: Build and push amd64 images 27 | uses: docker/build-push-action@v4 28 | with: 29 | context: ./frontend 30 | push: true 31 | platforms: linux/amd64 32 | tags: | 33 | mixeway/flow:latest 34 | mixeway/flow:latest-beta 35 | - name: Build and push arm64 images 36 | uses: docker/build-push-action@v4 37 | with: 38 | context: ./frontend 39 | push: true 40 | platforms: linux/arm64 41 | tags: | 42 | mixeway/flow:latest-arm 43 | mixeway/flow:latest-beta-arm 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /backend/target/ 2 | /frontend/.angular 3 | /frontend/node_modules 4 | .idea 5 | .DS_Store 6 | /frontend/.DS_Store 7 | /frontend/src/.DS_Store 8 | /frontend/src/assets/.DS_Store 9 | /backend/MixewayFlowAPI.iml 10 | #frontend/src/environments -------------------------------------------------------------------------------- /backend.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/backend.zip -------------------------------------------------------------------------------- /backend/HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | -------------------------------------------------------------------------------- /backend/README.md: -------------------------------------------------------------------------------- 1 | ## Prerequisites 2 | 3 | * git configured with proxy etc. 4 | * gitleaks command avaliable - https://github.com/gitleaks/gitleaks 5 | * KICS command with by default link do queries - https://github.com/Checkmarx/kics (require to contain asset location to be changed in application.properties) 6 | * bearer command with by default link to rules - https://github.com/Bearer/bearer it is required also to get bearer rules https://github.com/Bearer/bearer-rules 7 | * have postgress db avaliable: eg. `docker run --name my-postgres-container -e POSTGRES_DB=flow -e POSTGRES_USER=flow_user -e POSTGRES_PASSWORD=flow_pass -p 5432:5432 -d postgres:latest` 8 | 9 | ## application.properties 10 | change to your need 11 | 12 | ## First login 13 | `admin:admin` - then forced change 14 | 15 | ### debug postgresql 16 | ```shell 17 | docker run --name flow_db -e POSTGRES_PASSWORD=flow_pass -e POSTGRES_USER=flow_user -e POSTGRES_DB=flow -p 5433:5432 -v pgdata:/var/lib/postgresql/data -d postgres 18 | ``` 19 | -------------------------------------------------------------------------------- /backend/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/backend/src/.DS_Store -------------------------------------------------------------------------------- /backend/src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/backend/src/main/.DS_Store -------------------------------------------------------------------------------- /backend/src/main/java/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/backend/src/main/java/.DS_Store -------------------------------------------------------------------------------- /backend/src/main/java/io/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/backend/src/main/java/io/.DS_Store -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/backend/src/main/java/io/mixeway/.DS_Store -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/backend/src/main/java/io/mixeway/mixewayflowapi/.DS_Store -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/MixewayFlowApiApplication.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi; 2 | 3 | import lombok.extern.log4j.Log4j2; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | 8 | @SpringBootApplication 9 | @EnableScheduling 10 | @Log4j2 11 | public class MixewayFlowApiApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(MixewayFlowApiApplication.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/admin/dto/AdditionalScannerConfigDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.admin.dto; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.Settings; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | import lombok.Setter; 7 | 8 | @Getter 9 | @Setter 10 | @NoArgsConstructor 11 | public class AdditionalScannerConfigDto { 12 | private boolean wizEnabled; 13 | 14 | public static AdditionalScannerConfigDto fromSettings(Settings settings) { 15 | AdditionalScannerConfigDto dto = new AdditionalScannerConfigDto(); 16 | dto.setWizEnabled(settings.isEnableWiz()); 17 | return dto; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/admin/dto/ConfigScaRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.admin.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ConfigScaRequestDto { 7 | boolean scaTypeEmbedded; 8 | boolean scaTypeExternal; 9 | String scaApiUrl; 10 | String scaApiKey; 11 | } 12 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/admin/dto/ConfigSmtpRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.admin.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ConfigSmtpRequestDto { 7 | boolean enabled; 8 | String hostname; 9 | int port; 10 | String username; 11 | String password; 12 | boolean tls; 13 | boolean startls; 14 | } 15 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/admin/dto/ConfigWizRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.admin.dto; 2 | 3 | import jakarta.validation.constraints.NotNull; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | import lombok.Setter; 7 | 8 | @Getter 9 | @Setter 10 | @NoArgsConstructor 11 | public class ConfigWizRequestDto { 12 | @NotNull 13 | private boolean enabled; 14 | 15 | private String clientId; 16 | 17 | private String secret; 18 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/admin/dto/RunModeRequestDto.java: -------------------------------------------------------------------------------- 1 | // RunModeRequestDto.java 2 | package io.mixeway.mixewayflowapi.api.admin.dto; 3 | 4 | import jakarta.validation.constraints.NotNull; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class RunModeRequestDto { 9 | @NotNull(message = "Mode is required") 10 | private String mode; 11 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/auth/dto/AuthRequestDTO.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.auth.dto; 2 | 3 | import io.mixeway.mixewayflowapi.utils.DTO; 4 | import io.mixeway.mixewayflowapi.utils.DtoValidator; 5 | import jakarta.validation.constraints.NotBlank; 6 | import jakarta.validation.constraints.Pattern; 7 | import jakarta.validation.constraints.Size; 8 | import lombok.Getter; 9 | 10 | @Getter 11 | public final class AuthRequestDTO implements DTO { 12 | @NotBlank(message = "Username cannot be blank") 13 | @Size(max = 20, message = "Username must be up to 20 characters long") 14 | @Pattern(regexp = "^[a-zA-Z0-9]+$", message = "Username must be alphanumeric") 15 | private final String username; 16 | 17 | @NotBlank(message = "Password cannot be blank") 18 | private final String password; 19 | 20 | private AuthRequestDTO(String username, String password) { 21 | this.username = username; 22 | this.password = password; 23 | } 24 | 25 | public static AuthRequestDTO of(String username, String password) { 26 | AuthRequestDTO dto = new AuthRequestDTO(username, password); 27 | validate(dto); 28 | return dto; 29 | } 30 | 31 | private static void validate(AuthRequestDTO dto) { 32 | DtoValidator.validate(dto); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/auth/dto/JwtResponseDTO.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.auth.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @Builder 12 | public class JwtResponseDTO { 13 | private String accessToken; 14 | private boolean resetPassword; 15 | 16 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/auth/dto/ServiceStatusDTO.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.auth.dto; 2 | 3 | 4 | import lombok.Data; 5 | 6 | @Data 7 | public class ServiceStatusDTO { 8 | private String status; 9 | private String mode; 10 | 11 | public ServiceStatusDTO(String status, String mode){ 12 | this.status = status; 13 | this.mode = mode; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/auth/service/AuthService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.auth.service; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.UserInfo; 4 | import io.mixeway.mixewayflowapi.domain.user.FindUserService; 5 | import io.mixeway.mixewayflowapi.domain.user.UpdateUserService; 6 | import lombok.RequiredArgsConstructor; 7 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.security.Principal; 11 | import java.util.Optional; 12 | 13 | @Service 14 | @RequiredArgsConstructor 15 | public class AuthService { 16 | private final BCryptPasswordEncoder bCryptPasswordEncoder; 17 | private final FindUserService findUserService; 18 | private final UpdateUserService updateUserService; 19 | 20 | public void changeUserPassword(Principal principal, String password, String passwordRepeat){ 21 | UserInfo userInfo = findUserService.findUser(principal.getName()); 22 | if (userInfo!= null && (passwordRepeat.equals(password))){ 23 | updateUserService.changePassword(userInfo, password); 24 | } else { 25 | throw new UnsupportedOperationException("Error changing password"); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/cicd/dto/CodeRepoDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.cicd.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CodeRepoDto { 7 | String repoUrl; 8 | String branch; 9 | } 10 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/cicd/dto/ValidateStatusDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.cicd.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class ValidateStatusDto { 9 | String result; 10 | List detectedTreats; 11 | 12 | @Data 13 | public static class Threat { 14 | String location; 15 | String name; 16 | String severity; 17 | 18 | public Threat(String location, String name, String severity) { 19 | this.location = location; 20 | this.name = name; 21 | this.severity = severity; 22 | } 23 | } 24 | 25 | } 26 | 27 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/cloudsubscription/dto/CloudSubscriptionDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.cloudsubscription.dto; 2 | 3 | import jakarta.validation.constraints.NotBlank; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | import lombok.Setter; 7 | 8 | @Getter 9 | @Setter 10 | @NoArgsConstructor 11 | public class CloudSubscriptionDto { 12 | @NotBlank(message = "Name is required") 13 | private String name; 14 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/coderepo/dto/AggregatedRepoStatsDTO.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.coderepo.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class AggregatedRepoStatsDTO { 9 | 10 | private final List activeFindings; 11 | private final List removedFindingsList; 12 | private final List reviewedFindingsList; 13 | private final List averageFixTimeList; 14 | 15 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/coderepo/dto/ChangeTeamRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.coderepo.dto; 2 | 3 | import jakarta.validation.constraints.NotNull; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | import lombok.Setter; 7 | 8 | @Getter 9 | @Setter 10 | @NoArgsConstructor 11 | public class ChangeTeamRequestDto { 12 | @NotNull(message = "New team ID is required") 13 | private Long newTeamId; 14 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/coderepo/dto/CommentDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.coderepo.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.time.LocalDateTime; 6 | import java.util.Date; 7 | 8 | @Data 9 | public class CommentDto { 10 | private LocalDateTime inserted; 11 | private String author; 12 | private String message; 13 | 14 | public CommentDto(LocalDateTime inserted, String author, String message) { 15 | this.inserted = inserted; 16 | this.author = author; 17 | this.message = message; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/coderepo/dto/CreateCommentRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.coderepo.dto; 2 | 3 | import jakarta.validation.constraints.NotBlank; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class CreateCommentRequestDto { 8 | @NotBlank(message = "Comment message cannot be blank") 9 | private String message; 10 | } 11 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/coderepo/dto/DailyFindingsProjection.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.coderepo.dto; 2 | 3 | import java.time.LocalDate; 4 | 5 | public interface DailyFindingsProjection { 6 | LocalDate getDate(); 7 | int getFindings(); 8 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/coderepo/dto/GetFindingResponseDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.coderepo.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class GetFindingResponseDto { 9 | VulnsResponseDto vulnsResponseDto; 10 | String description; 11 | String recommendation; 12 | String explanation; 13 | String refs; 14 | List comments; 15 | } 16 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/coderepo/dto/VulnStatsResponseDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.coderepo.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class VulnStatsResponseDto { 7 | Long sast; 8 | Long iac; 9 | Long sca; 10 | Long secrets; 11 | Long gitlab; 12 | public VulnStatsResponseDto(Long sast, Long iac, Long sca, Long secrets,Long gitlab) { 13 | this.sast = sast; 14 | this.iac = iac; 15 | this.sca = sca; 16 | this.secrets = secrets; 17 | this.gitlab = gitlab; 18 | } 19 | 20 | public VulnStatsResponseDto(){}; 21 | } 22 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/coderepo/dto/VulnsResponseDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.coderepo.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class VulnsResponseDto { 8 | Long id; 9 | String name; 10 | String location; 11 | String source; 12 | String status; 13 | String severity; 14 | String inserted; 15 | @JsonProperty("last_seen") 16 | String lastSeen; 17 | } 18 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/coderepo/mapper/FindingMapper.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.coderepo.mapper; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.Finding; 4 | import io.mixeway.mixewayflowapi.api.coderepo.dto.VulnsResponseDto; 5 | 6 | import java.util.List; 7 | import java.util.stream.Collectors; 8 | 9 | public class FindingMapper { 10 | 11 | public static VulnsResponseDto mapToDto(Finding finding) { 12 | VulnsResponseDto dto = new VulnsResponseDto(); 13 | dto.setId(finding.getId()); 14 | dto.setName(finding.getVulnerability().getName()); 15 | dto.setLocation(finding.getLocation()); 16 | dto.setSource(finding.getSource().name()); 17 | dto.setSeverity(finding.getSeverity().name()); 18 | dto.setStatus(finding.getStatus().name()); 19 | dto.setInserted(finding.getInsertedDate().toString()); 20 | dto.setLastSeen(finding.getUpdatedDate().toString()); 21 | return dto; 22 | } 23 | 24 | public static List mapToDtoList(List findings) { 25 | return findings.stream() 26 | .map(FindingMapper::mapToDto) 27 | .collect(Collectors.toList()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/components/dto/ComponentDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.components.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ComponentDto { 7 | String name; 8 | String version; 9 | String groupId; 10 | Long id; 11 | } 12 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/components/dto/ComponentProjectionDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.components.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class ComponentProjectionDto { 9 | private Long componentId; 10 | private String componentName; 11 | private List vulnerabilityNames; 12 | private List affectedRepoUrls; 13 | 14 | // Constructor 15 | public ComponentProjectionDto(Long componentId, String componentName, List vulnerabilityNames, List affectedRepoUrls) { 16 | this.componentId = componentId; 17 | this.componentName = componentName; 18 | this.vulnerabilityNames = vulnerabilityNames; 19 | this.affectedRepoUrls = affectedRepoUrls; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/components/dto/ComponentRawDataDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.components.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ComponentRawDataDto { 7 | private Long componentId; 8 | private String componentName; 9 | private String componentVersion; 10 | private String componentGroupId; 11 | private String vulnerabilityName; 12 | private String repoUrl; 13 | 14 | public ComponentRawDataDto(Long componentId, String componentName, String componentVersion, String componentGroupId, String vulnerabilityName, String repoUrl) { 15 | this.componentId = componentId; 16 | this.componentVersion = componentVersion; 17 | this.componentGroupId = componentGroupId; 18 | this.componentName = componentName; 19 | this.vulnerabilityName = vulnerabilityName; 20 | this.repoUrl = repoUrl; 21 | } 22 | 23 | // Getters and setters... 24 | } 25 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/components/dto/GetComponentsResponseDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.components.dto; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.Component; 4 | import io.mixeway.mixewayflowapi.db.entity.Vulnerability; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | import java.util.List; 10 | 11 | @Data 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | public class GetComponentsResponseDto { 15 | ComponentDto component; 16 | Long componentId; 17 | String componentName; 18 | String componentVersion; 19 | String componentGroupId; 20 | List vulnerabilityNames; 21 | List vulnerabilities; 22 | List affectedReposUrl; 23 | } 24 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/organization/dto/OrganizationCreateRequestDto.java: -------------------------------------------------------------------------------- 1 | // OrganizationCreateRequestDto.java 2 | package io.mixeway.mixewayflowapi.api.organization.dto; 3 | 4 | import jakarta.validation.constraints.NotBlank; 5 | import jakarta.validation.constraints.NotNull; 6 | import lombok.Data; 7 | 8 | @Data 9 | public class OrganizationCreateRequestDto { 10 | @NotBlank(message = "Organization name is required") 11 | private String name; 12 | 13 | @NotNull(message = "Plan type is required") 14 | private String planType; 15 | 16 | @NotNull(message = "Admin user ID is required") 17 | private Long adminUserId; 18 | 19 | private boolean active = true; 20 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/organization/dto/OrganizationDto.java: -------------------------------------------------------------------------------- 1 | // OrganizationDto.java 2 | package io.mixeway.mixewayflowapi.api.organization.dto; 3 | 4 | import lombok.AllArgsConstructor; 5 | import lombok.Builder; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | import java.time.LocalDateTime; 10 | 11 | @Data 12 | @Builder 13 | @NoArgsConstructor 14 | @AllArgsConstructor 15 | public class OrganizationDto { 16 | private Long id; 17 | private String name; 18 | private String planType; 19 | private LocalDateTime createdDate; 20 | private boolean active; 21 | private int teamCount; 22 | private int repoCount; 23 | private int userCount; 24 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/organization/dto/OrganizationUpdateRequestDto.java: -------------------------------------------------------------------------------- 1 | // OrganizationUpdateRequestDto.java 2 | package io.mixeway.mixewayflowapi.api.organization.dto; 3 | 4 | import jakarta.validation.constraints.NotBlank; 5 | import jakarta.validation.constraints.NotNull; 6 | import lombok.Data; 7 | 8 | @Data 9 | public class OrganizationUpdateRequestDto { 10 | @NotNull(message = "Organization ID is required") 11 | private Long id; 12 | 13 | @NotBlank(message = "Organization name is required") 14 | private String name; 15 | 16 | @NotNull(message = "Plan type is required") 17 | private String planType; 18 | 19 | @NotNull(message = "Admin user ID is required") 20 | private Long adminUserId; 21 | 22 | private boolean active = true; 23 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/organization/dto/TeamDto.java: -------------------------------------------------------------------------------- 1 | // TeamDto.java 2 | package io.mixeway.mixewayflowapi.api.organization.dto; 3 | 4 | import lombok.AllArgsConstructor; 5 | import lombok.Builder; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | @Data 10 | @Builder 11 | @NoArgsConstructor 12 | @AllArgsConstructor 13 | public class TeamDto { 14 | private Long id; 15 | private String name; 16 | private int repoCount; 17 | private int userCount; 18 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/organization/dto/UserDto.java: -------------------------------------------------------------------------------- 1 | // UserDto.java 2 | package io.mixeway.mixewayflowapi.api.organization.dto; 3 | 4 | import lombok.AllArgsConstructor; 5 | import lombok.Builder; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | @Data 10 | @Builder 11 | @NoArgsConstructor 12 | @AllArgsConstructor 13 | public class UserDto { 14 | private Long id; 15 | private String username; 16 | private String highestRole; 17 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/team/dto/ChangeTeamRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.team.dto; 2 | 3 | import io.mixeway.mixewayflowapi.utils.DTO; 4 | import io.mixeway.mixewayflowapi.utils.DtoValidator; 5 | import jakarta.validation.constraints.Min; 6 | import jakarta.validation.constraints.NotNull; 7 | import jakarta.validation.constraints.Size; 8 | import lombok.Getter; 9 | 10 | import java.util.List; 11 | 12 | @Getter 13 | public final class ChangeTeamRequestDto implements DTO { 14 | 15 | @NotNull(message = "ID must not be null") 16 | @Min(value = 1, message = "ID must be greater than 0") 17 | private final Long id; 18 | 19 | @Size(max = 100, message = "Users list can have a maximum of 100 elements") 20 | private final List users; 21 | 22 | private ChangeTeamRequestDto(Long id, List users) { 23 | this.id = id; 24 | this.users = users; 25 | } 26 | 27 | public static ChangeTeamRequestDto of(Long id, List users) { 28 | ChangeTeamRequestDto dto = new ChangeTeamRequestDto(id, users); 29 | DtoValidator.validate(dto); 30 | return dto; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/team/dto/CreateTeamRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.team.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class CreateTeamRequestDto { 9 | String name; 10 | String remoteIdentifier; 11 | List users; 12 | } 13 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/team/dto/SimpleUserDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.team.dto; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | @Data 7 | @Builder 8 | public class SimpleUserDto { 9 | Long id; 10 | String username; 11 | } 12 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/team/dto/TeamDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.team.dto; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | @Builder 10 | public class TeamDto { 11 | Long id; 12 | String name; 13 | String remoteIdentifier; 14 | List users; 15 | } 16 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/team/dto/TeamIdDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.team.dto; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | @Builder 7 | @Data 8 | public class TeamIdDto { 9 | String remoteIdentifier; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/teamfindings/dto/CombinedDailyStatsDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.teamfindings.dto; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.List; 7 | 8 | @Getter 9 | @Setter 10 | public class CombinedDailyStatsDto { 11 | private List codeReposStats; 12 | private List cloudSubscriptionsStats; 13 | 14 | public CombinedDailyStatsDto(List codeReposStats, List cloudSubscriptionsStats) { 15 | this.codeReposStats = codeReposStats; 16 | this.cloudSubscriptionsStats = cloudSubscriptionsStats; 17 | } 18 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/teamfindings/dto/DailyCloudSubscriptionsStatsDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.teamfindings.dto; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.time.LocalDate; 7 | 8 | @Getter 9 | @Setter 10 | public class DailyCloudSubscriptionsStatsDto { 11 | private LocalDate date; 12 | private int criticalFindings, highFindings; 13 | private int openedFindings, removedFindings; 14 | private double averageFixTime; 15 | 16 | public DailyCloudSubscriptionsStatsDto(LocalDate date, int criticalFindings, int highFindings, 17 | int openedFindings, int removedFindings, double averageFixTime) { 18 | this.date = date; 19 | this.criticalFindings = criticalFindings; 20 | this.highFindings = highFindings; 21 | this.openedFindings = openedFindings; 22 | this.removedFindings = removedFindings; 23 | this.averageFixTime = averageFixTime; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/teamfindings/dto/TeamFindingsAndVulnsResponseDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.teamfindings.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import lombok.Data; 5 | 6 | import java.math.BigDecimal; 7 | 8 | @Data 9 | public class TeamFindingsAndVulnsResponseDto { 10 | Long id; 11 | String name; 12 | String location; 13 | @JsonProperty("component_name") 14 | String componentName; 15 | @JsonProperty("remote_id") 16 | String remoteId; 17 | String source; 18 | String status; 19 | String severity; 20 | String inserted; 21 | @JsonProperty("last_seen") 22 | String lastSeen; 23 | String description; 24 | String explanation; 25 | String recommendation; 26 | BigDecimal epss; 27 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/teamfindings/dto/TeamVulnStatsResponseDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.teamfindings.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class TeamVulnStatsResponseDto { 7 | Long sast; 8 | Long iac; 9 | Long sca; 10 | Long secrets; 11 | Long gitlab; 12 | Long cloud; 13 | public TeamVulnStatsResponseDto(Long sast, Long iac, Long sca, Long secrets, Long gitlab, Long cloud) { 14 | this.sast = sast; 15 | this.iac = iac; 16 | this.sca = sca; 17 | this.secrets = secrets; 18 | this.gitlab = gitlab; 19 | this.cloud = cloud; 20 | } 21 | 22 | public TeamVulnStatsResponseDto(){}; 23 | } 24 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/teamfindings/dto/TeamVulnsResponseDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.teamfindings.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class TeamVulnsResponseDto { 8 | Long id; 9 | String name; 10 | String location; 11 | String source; 12 | String status; 13 | String severity; 14 | String inserted; 15 | @JsonProperty("last_seen") 16 | String lastSeen; 17 | @JsonProperty("component_name") 18 | String componentName; 19 | 20 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/threatintel/dto/ItemListResponse.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.threatintel.dto; 2 | 3 | import io.mixeway.mixewayflowapi.db.projection.Item; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class ItemListResponse { 10 | private List items; 11 | private int numberOfUniqueProjects; 12 | private int numberOfAllProjects; 13 | private int numberOfTeams; 14 | private Long openedVulnerabilities; 15 | 16 | // Constructors 17 | public ItemListResponse() { } 18 | 19 | public ItemListResponse(List items, int numberOfUniqueProjects) { 20 | this.items = items; 21 | this.numberOfUniqueProjects = numberOfUniqueProjects; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/threatintel/dto/SuppressRuleDTO.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.threatintel.dto; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class SuppressRuleDTO { 9 | 10 | private String scope; // "GLOBAL", "TEAM", or "PROJECT" 11 | private String vulnerabilityId; // ID of the vulnerability 12 | private Long teamId; // Optional, required if scope is "TEAM" 13 | private Long codeRepoId; // Optional, required if scope is "PROJECT" 14 | private String pathRegex; // Optional, path regex pattern for file paths 15 | 16 | // Constructor 17 | public SuppressRuleDTO(long ownerId, String scope, String vulnerabilityId, Long teamId, Long codeRepoId, String pathRegex) { 18 | this.scope = scope; 19 | this.vulnerabilityId = vulnerabilityId; 20 | this.teamId = teamId; 21 | this.codeRepoId = codeRepoId; 22 | this.pathRegex = pathRegex; 23 | } 24 | 25 | // Default constructor 26 | public SuppressRuleDTO() { 27 | } 28 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/threatintel/dto/SuppressRuleResponseDTO.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.threatintel.dto; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.SuppressRule; 4 | import lombok.Data; 5 | 6 | import java.time.LocalDateTime; 7 | 8 | @Data 9 | public class SuppressRuleResponseDTO { 10 | private Long id; 11 | private String vulnerabilityName; 12 | private SuppressRule.Scope scope; 13 | private String scopeDetail; 14 | private String pathRegex; 15 | private String insertedBy; 16 | private LocalDateTime insertedDate; 17 | 18 | // Constructor 19 | public SuppressRuleResponseDTO(Long id, String vulnerabilityName, SuppressRule.Scope scope, String scopeDetail, 20 | String pathRegex, String insertedBy, LocalDateTime insertedDate) { 21 | this.id = id; 22 | this.vulnerabilityName = vulnerabilityName; 23 | this.scope = scope; 24 | this.scopeDetail = scopeDetail; 25 | this.pathRegex = pathRegex; 26 | this.insertedBy = insertedBy; 27 | this.insertedDate = insertedDate; 28 | } 29 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/threatintel/service/SuppressRuleService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.threatintel.service; 2 | 3 | import io.mixeway.mixewayflowapi.api.threatintel.dto.SuppressRuleDTO; 4 | import io.mixeway.mixewayflowapi.domain.suppressrule.CreateSuppressRuleService; 5 | import io.mixeway.mixewayflowapi.domain.suppressrule.DeleteSuppressRuleService; 6 | import lombok.RequiredArgsConstructor; 7 | import lombok.extern.log4j.Log4j2; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.security.Principal; 11 | 12 | @Service 13 | @RequiredArgsConstructor 14 | @Log4j2 15 | public class SuppressRuleService { 16 | private final DeleteSuppressRuleService deleteSuppressRuleService; 17 | private final CreateSuppressRuleService createSuppressRuleService; 18 | 19 | public void deleteRule(Long id){ 20 | deleteSuppressRuleService.removeRule(id); 21 | } 22 | 23 | public void createRule(SuppressRuleDTO suppressRuleDTO, Principal principal) { 24 | createSuppressRuleService.createRule(suppressRuleDTO,principal); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/user/dto/AppModeInfoDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.user.dto; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | @Data 7 | @Builder 8 | public class AppModeInfoDto { 9 | private String mode; // "STANDALONE" or "SAAS" 10 | private UserQuotaInfoDto quotaInfo; // null if in STANDALONE mode 11 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/user/dto/ChangePasswordDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.user.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import io.mixeway.mixewayflowapi.utils.DTO; 5 | import io.mixeway.mixewayflowapi.utils.DtoValidator; 6 | import jakarta.validation.constraints.NotEmpty; 7 | import jakarta.validation.constraints.NotNull; 8 | import jakarta.validation.constraints.Size; 9 | import lombok.Getter; 10 | 11 | @Getter 12 | public final class ChangePasswordDto implements DTO { 13 | 14 | @NotNull(message = "Password must not be null") 15 | @NotEmpty(message = "Password must not be empty") 16 | @Size(min = 8, message = "The length of the password must be at least 8 characters") 17 | private final String password; 18 | 19 | @JsonCreator 20 | private ChangePasswordDto(String password) { 21 | this.password = password; 22 | validate(this); 23 | } 24 | 25 | public static ChangePasswordDto of(String password) { 26 | ChangePasswordDto dto = new ChangePasswordDto(password); 27 | validate(dto); 28 | return dto; 29 | } 30 | 31 | private static void validate(ChangePasswordDto dto) { 32 | DtoValidator.validate(dto); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/user/dto/ChangeRoleRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.user.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import io.mixeway.mixewayflowapi.utils.DTO; 5 | import io.mixeway.mixewayflowapi.utils.DtoValidator; 6 | import io.mixeway.mixewayflowapi.utils.Role; 7 | import jakarta.validation.constraints.NotNull; 8 | import lombok.Getter; 9 | 10 | @Getter 11 | public final class ChangeRoleRequestDto implements DTO { 12 | 13 | @NotNull(message = "Role must not be null") 14 | private final Role role; 15 | 16 | @JsonCreator 17 | private ChangeRoleRequestDto(Role role) { 18 | this.role = role; 19 | validate(this); 20 | } 21 | 22 | public static ChangeRoleRequestDto of(Role role) { 23 | ChangeRoleRequestDto dto = new ChangeRoleRequestDto(role); 24 | validate(dto); 25 | return dto; 26 | } 27 | 28 | private static void validate(ChangeRoleRequestDto dto) { 29 | DtoValidator.validate(dto); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/user/dto/ChangeTeamRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.user.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import io.mixeway.mixewayflowapi.utils.DTO; 6 | import io.mixeway.mixewayflowapi.utils.DtoValidator; 7 | import jakarta.validation.constraints.Size; 8 | import lombok.Getter; 9 | 10 | import java.util.List; 11 | 12 | @Getter 13 | public final class ChangeTeamRequestDto implements DTO { 14 | 15 | @Size(max = 100, message = "Teams list can have a maximum of 100 elements") 16 | private final List teams; 17 | 18 | 19 | 20 | @JsonCreator 21 | private ChangeTeamRequestDto(List teams) { 22 | this.teams = teams; 23 | validate(this); 24 | } 25 | 26 | public static ChangeTeamRequestDto of(List teams) { 27 | ChangeTeamRequestDto dto = new ChangeTeamRequestDto(teams); 28 | validate(dto); 29 | return dto; 30 | } 31 | 32 | private static void validate(ChangeTeamRequestDto dto) { 33 | DtoValidator.validate(dto); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/user/dto/QuotaLimitsDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.user.dto; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | @Data 7 | @Builder 8 | public class QuotaLimitsDto { 9 | private int maxTeams; 10 | private int maxReposPerTeam; 11 | private int maxUsersPerTeam; 12 | private int maxTotalRepos; // Calculated as maxTeams * maxReposPerTeam 13 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/user/dto/QuotaUsageDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.user.dto; 2 | import lombok.Builder; 3 | import lombok.Data; 4 | 5 | @Data 6 | @Builder 7 | public class QuotaUsageDto { 8 | private int teamsCount; 9 | private int totalReposCount; 10 | private int usersCount; 11 | private double teamUsagePercentage; 12 | private double repoUsagePercentage; 13 | } 14 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/user/dto/UserDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.user.dto; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.Team; 4 | import io.mixeway.mixewayflowapi.db.entity.UserInfo; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class UserDto { 11 | Long id; 12 | String username; 13 | String role; 14 | List teams; 15 | Boolean active; 16 | 17 | public UserDto(UserInfo userInfo){ 18 | this.id = userInfo.getId(); 19 | this.username = userInfo.getUsername(); 20 | this.teams = userInfo.getTeams().stream().toList(); 21 | this.active = userInfo.isActive(); 22 | this.role = userInfo.getHighestRole(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/user/dto/UserQuotaInfoDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.user.dto; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import java.util.List; 6 | 7 | @Data 8 | @Builder 9 | public class UserQuotaInfoDto { 10 | private String planType; // "FREE", "SMALL_COMPANY", or "ENTERPRISE" 11 | private String organizationName; 12 | private Long organizationId; 13 | private QuotaLimitsDto limits; 14 | private QuotaUsageDto usage; 15 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/vulnerabilities/dto/EditVulnerabilityRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.vulnerabilities.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class EditVulnerabilityRequestDto { 7 | Long id; 8 | String description; 9 | String ref; 10 | String recommendation; 11 | } 12 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/vulnerabilities/dto/GetVulnerabilitiesResponseDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.vulnerabilities.dto; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.Vulnerability; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | import java.util.List; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class GetVulnerabilitiesResponseDto { 14 | Vulnerability vulnerability; 15 | List affectedRepositories; 16 | } 17 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/vulnerabilities/dto/VulnerabilityDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.vulnerabilities.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class VulnerabilityDto { 7 | String name; 8 | String description; 9 | String recommendation; 10 | String ref; 11 | Long id; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/vulnerabilities/dto/VulnerabilityRawDataDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.vulnerabilities.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class VulnerabilityRawDataDto { 7 | private Long vulnerabilityId; 8 | private String vulnerabilityName; 9 | private String vulnerabilityDescription; 10 | private String vulnerabilityRecommendation; 11 | private String vulnerabilityRefs; 12 | private String codeRepoUrl; 13 | 14 | public VulnerabilityRawDataDto(Long vulnerabilityId, String vulnerabilityName, String vulnerabilityDescription, 15 | String vulnerabilityRecommendation, String vulnerabilityRefs, String codeRepoUrl) { 16 | this.vulnerabilityId = vulnerabilityId; 17 | this.vulnerabilityName = vulnerabilityName; 18 | this.vulnerabilityDescription = vulnerabilityDescription; 19 | this.vulnerabilityRecommendation = vulnerabilityRecommendation; 20 | this.vulnerabilityRefs = vulnerabilityRefs; 21 | this.codeRepoUrl = codeRepoUrl; 22 | } 23 | 24 | // Getters and setters... 25 | } 26 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/webhook/dto/GHMergeEventDTO.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.webhook.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class GHMergeEventDTO { 7 | private PullRequestDTO pullRequest; 8 | private RepositoryDTO repository; 9 | 10 | @Data 11 | public static class PullRequestDTO { 12 | private Long id; 13 | private HeadDTO head; 14 | private BaseDTO base; 15 | private String state; 16 | 17 | @Data 18 | public static class HeadDTO { 19 | private String ref; 20 | private String sha; 21 | } 22 | 23 | @Data 24 | public static class BaseDTO { 25 | private String ref; 26 | private String sha; 27 | } 28 | } 29 | 30 | @Data 31 | public static class RepositoryDTO { 32 | private Long id; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/webhook/dto/GHPushEventDTO.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.webhook.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class GHPushEventDTO { 7 | private String ref; 8 | private String after; 9 | private RepositoryDTO repository; 10 | 11 | 12 | @Data 13 | public static class RepositoryDTO { 14 | private Long id; 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/webhook/dto/GLMergeEventDTO.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.webhook.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class GLMergeEventDTO { 8 | private ProjectDTO project; 9 | @JsonProperty("object_attributes") 10 | private ObjectAttributesDTO objectAttributes; 11 | 12 | @Data 13 | public static class ProjectDTO { 14 | private Long id; 15 | private String web_url; 16 | 17 | } 18 | 19 | @Data 20 | public static class ObjectAttributesDTO { 21 | @JsonProperty("source_branch") 22 | private String sourceBranch; 23 | @JsonProperty("target_branch") 24 | private String targetBranch; 25 | private String url; 26 | @JsonProperty("last_commit") 27 | private LastCommitDTO lastCommitDTO; 28 | private Long iid; 29 | private String state; 30 | 31 | @Data 32 | public static class LastCommitDTO { 33 | String id; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/api/webhook/dto/GLPushEventDTO.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.api.webhook.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class GLPushEventDTO { 7 | private String ref; 8 | private String after; 9 | private ProjectDTO project; 10 | 11 | 12 | @Data 13 | public static class ProjectDTO { 14 | private Long id; 15 | private String web_url; 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/auth/CustomAuthenticationEntryPoint.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.auth; 2 | 3 | import jakarta.servlet.http.HttpServletRequest; 4 | import jakarta.servlet.http.HttpServletResponse; 5 | import org.springframework.security.core.AuthenticationException; 6 | import org.springframework.security.web.AuthenticationEntryPoint; 7 | import org.springframework.stereotype.Component; 8 | 9 | import java.io.IOException; 10 | 11 | @Component 12 | public class CustomAuthenticationEntryPoint implements AuthenticationEntryPoint { 13 | 14 | @Override 15 | public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException { 16 | if (request.getServletPath().startsWith("/api/")) { 17 | response.sendError(HttpServletResponse.SC_FORBIDDEN, "Access Denied"); 18 | } else { 19 | response.sendRedirect("/oauth2/authorization/sso"); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/auth/UserDetailsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.auth; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.UserInfo; 4 | import io.mixeway.mixewayflowapi.db.repository.UserRepository; 5 | import lombok.extern.log4j.Log4j2; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.security.core.userdetails.UserDetails; 8 | import org.springframework.security.core.userdetails.UserDetailsService; 9 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 10 | import org.springframework.stereotype.Component; 11 | 12 | @Component 13 | @Log4j2 14 | public class UserDetailsServiceImpl implements UserDetailsService { 15 | 16 | @Autowired 17 | private UserRepository userRepository; 18 | 19 | 20 | @Override 21 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { 22 | 23 | log.debug("Entering in loadUserByUsername Method..."); 24 | UserInfo user = userRepository.findByUsername(username); 25 | if(user == null){ 26 | //log.error("Username not found: " + username); 27 | throw new UsernameNotFoundException("could not found user..!!"); 28 | } 29 | return new CustomUserDetails(user); 30 | } 31 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/config/BCryptEncoderConfig.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 6 | 7 | @Configuration 8 | public class BCryptEncoderConfig { 9 | @Bean 10 | public BCryptPasswordEncoder passwordEncoder() { 11 | return new BCryptPasswordEncoder(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 6 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 7 | 8 | @Configuration 9 | public class WebConfig implements WebMvcConfigurer { 10 | 11 | @Bean 12 | public WebMvcConfigurer corsConfigurer() { 13 | return new WebMvcConfigurer() { 14 | @Override 15 | public void addCorsMappings(CorsRegistry registry) { 16 | registry.addMapping("/**") 17 | .allowedOriginPatterns("*") // Use allowedOriginPatterns 18 | .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") 19 | .allowedHeaders("*") 20 | .allowCredentials(true) 21 | .maxAge(3600); // Cache the response for 1 hour 22 | } 23 | }; 24 | } 25 | 26 | 27 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/entity/AppConfig.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.entity; 2 | 3 | import jakarta.persistence.*; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Entity 8 | @Getter 9 | @NoArgsConstructor 10 | @Table(name = "app_config") 11 | public class AppConfig { 12 | 13 | @Id 14 | @GeneratedValue(strategy = GenerationType.IDENTITY) 15 | private Long id; 16 | 17 | @Column(name = "config_key", nullable = false, unique = true) 18 | private String key; 19 | 20 | @Column(name = "config_value", nullable = false) 21 | private String value; 22 | 23 | // Constructor 24 | public AppConfig(String key, String value) { 25 | this.key = key; 26 | this.value = value; 27 | } 28 | 29 | // Update value 30 | public void updateValue(String value) { 31 | this.value = value; 32 | } 33 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/entity/PlanLimits.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.entity; 2 | 3 | import jakarta.persistence.*; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Entity 8 | @Getter 9 | @NoArgsConstructor 10 | @Table(name = "plan_limits") 11 | public class PlanLimits { 12 | 13 | @Id 14 | @GeneratedValue(strategy = GenerationType.IDENTITY) 15 | private Long id; 16 | 17 | @Column(name = "plan_type", nullable = false, unique = true) 18 | private String planType; 19 | 20 | @Column(name = "max_teams", nullable = false) 21 | private int maxTeams; 22 | 23 | @Column(name = "max_repos_per_team", nullable = false) 24 | private int maxReposPerTeam; 25 | 26 | @Column(name = "max_users_per_team", nullable = false) 27 | private int maxUsersPerTeam; 28 | 29 | // Constructor 30 | public PlanLimits(String planType, int maxTeams, int maxReposPerTeam, int maxUsersPerTeam) { 31 | this.planType = planType; 32 | this.maxTeams = maxTeams; 33 | this.maxReposPerTeam = maxReposPerTeam; 34 | this.maxUsersPerTeam = maxUsersPerTeam; 35 | } 36 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/entity/UserRole.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.entity; 2 | 3 | import jakarta.persistence.*; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | import lombok.ToString; 8 | 9 | @Entity 10 | @Data 11 | @ToString 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | @Table(name = "roles") 15 | public class UserRole { 16 | 17 | @Id 18 | @GeneratedValue(strategy = GenerationType.IDENTITY) 19 | @Column(name = "ID") 20 | private long id; 21 | private String name; 22 | 23 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/projection/Item.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.projection; 2 | 3 | import lombok.Data; 4 | 5 | import java.math.BigDecimal; 6 | import java.util.List; 7 | 8 | @Data 9 | public class Item { 10 | private String name; 11 | private String urgency; 12 | private int count; 13 | private BigDecimal epss; 14 | private boolean pii; 15 | private boolean exploitAvailable; 16 | private List projects; 17 | 18 | // Constructors, getters, and setters 19 | // ... 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/projection/ItemDTO.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.projection; 2 | 3 | import lombok.Data; 4 | 5 | import java.math.BigDecimal; 6 | import java.util.List; 7 | 8 | @Data 9 | public class ItemDTO { 10 | private Long coderepoId; 11 | private String name; 12 | private String urgency; 13 | private int count; 14 | private BigDecimal epss; 15 | private Boolean pii; 16 | private Boolean exploitAvailable; 17 | private List projectNames; 18 | private List projectIds; 19 | } 20 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/projection/ItemProjection.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.projection; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.List; 5 | 6 | public interface ItemProjection { 7 | Long getCoderepoId(); 8 | String getName(); 9 | String getUrgency(); 10 | int getCount(); 11 | BigDecimal getEpss(); 12 | boolean isPii(); 13 | boolean isExploitAvailable(); 14 | List getProjectNames(); 15 | List getProjectIds(); 16 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/projection/Project.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.projection; 2 | 3 | 4 | import lombok.Data; 5 | 6 | @Data 7 | public class Project { 8 | private String name; 9 | private String href; 10 | 11 | // Constructors, getters, and setters 12 | // ... 13 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/projection/RemovedVulnerabilityProjection.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.projection; 2 | 3 | import java.util.Date; 4 | 5 | public interface RemovedVulnerabilityProjection { 6 | String getName(); 7 | String getRepositoryUrl(); 8 | Long getCodeRepoId(); 9 | Date getDateDeleted(); 10 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/projection/ReviewedVulnerabilityProjection.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.projection; 2 | 3 | public interface ReviewedVulnerabilityProjection { 4 | String getName(); 5 | String getRepositoryUrl(); 6 | String getStatus(); 7 | Long getCodeRepoId(); 8 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/repository/AppConfigRepository.java: -------------------------------------------------------------------------------- 1 | // AppConfigRepository.java 2 | package io.mixeway.mixewayflowapi.db.repository; 3 | 4 | import io.mixeway.mixewayflowapi.db.entity.AppConfig; 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.Optional; 9 | 10 | @Repository 11 | public interface AppConfigRepository extends JpaRepository { 12 | Optional findByKey(String key); 13 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/repository/AppDataTypeRepository.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.repository; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.AppDataType; 4 | import io.mixeway.mixewayflowapi.db.entity.CodeRepo; 5 | import io.mixeway.mixewayflowapi.db.entity.CodeRepoBranch; 6 | import org.springframework.data.repository.CrudRepository; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.Optional; 10 | 11 | @Repository 12 | public interface AppDataTypeRepository extends CrudRepository { 13 | void deleteAllByCodeRepo(CodeRepo codeRepo); 14 | 15 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/repository/CloudScanInfoRepository.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.repository; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.CloudSubscription; 4 | import io.mixeway.mixewayflowapi.db.entity.CloudScanInfo; 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.Optional; 9 | 10 | @Repository 11 | public interface CloudScanInfoRepository extends CrudRepository { 12 | 13 | Optional findByCloudSubscription(CloudSubscription cloudSubscription); 14 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/repository/CloudSubscriptionFindingStatsRepository.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.repository; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.CloudSubscription; 4 | import io.mixeway.mixewayflowapi.db.entity.CloudSubscriptionFindingStats; 5 | import org.springframework.data.domain.Pageable; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.data.repository.CrudRepository; 8 | import org.springframework.data.repository.query.Param; 9 | import org.springframework.stereotype.Repository; 10 | 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | @Repository 15 | public interface CloudSubscriptionFindingStatsRepository extends CrudRepository { 16 | 17 | @Query("SELECT s FROM CloudSubscriptionFindingStats s WHERE s.cloudSubscription = :cloudSubscription ORDER BY s.dateInserted DESC limit 14") 18 | List findTop14ByCloudSubscriptionOrderByDateInsertedDesc(@Param("cloudSubscription") CloudSubscription cloudSubscription); 19 | 20 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/repository/CodeRepoBranchRepository.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.repository; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.CodeRepo; 4 | import io.mixeway.mixewayflowapi.db.entity.CodeRepoBranch; 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.Optional; 9 | 10 | @Repository 11 | public interface CodeRepoBranchRepository extends CrudRepository { 12 | Optional findByNameAndCodeRepo(String name, CodeRepo codeRepo); 13 | 14 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/repository/CommentRepository.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.repository; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.Comment; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface CommentRepository extends JpaRepository { 7 | } 8 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/repository/PlanLimitsRepository.java: -------------------------------------------------------------------------------- 1 | // PlanLimitsRepository.java 2 | package io.mixeway.mixewayflowapi.db.repository; 3 | 4 | import io.mixeway.mixewayflowapi.db.entity.PlanLimits; 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.Optional; 9 | 10 | @Repository 11 | public interface PlanLimitsRepository extends JpaRepository { 12 | Optional findByPlanType(String planType); 13 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/repository/RepositoryAllowlistRepository.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.repository; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.RepositoryAllowlist; 4 | import org.springframework.data.repository.CrudRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | @Repository 10 | public interface RepositoryAllowlistRepository extends CrudRepository { 11 | List findAll(); 12 | } 13 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/repository/ScanInfoRepository.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.repository; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.CodeRepo; 4 | import io.mixeway.mixewayflowapi.db.entity.CodeRepoBranch; 5 | import io.mixeway.mixewayflowapi.db.entity.ScanInfo; 6 | import org.springframework.data.repository.CrudRepository; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.List; 10 | import java.util.Optional; 11 | 12 | @Repository 13 | public interface ScanInfoRepository extends CrudRepository { 14 | 15 | Optional findByCodeRepoAndCodeRepoBranchAndCommitId(CodeRepo codeRepo, CodeRepoBranch codeRepoBranch, String commitId); 16 | List findByCodeRepo(CodeRepo repo); 17 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/repository/SettingsRepository.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.repository; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.Settings; 4 | import io.mixeway.mixewayflowapi.db.entity.UserInfo; 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | @Repository 11 | public interface SettingsRepository extends CrudRepository { 12 | public List findAll(); 13 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.repository; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.UserInfo; 4 | import org.springframework.data.jpa.repository.Query; 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.data.repository.query.Param; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.List; 10 | import java.util.Optional; 11 | 12 | @Repository 13 | public interface UserRepository extends CrudRepository { 14 | public UserInfo findByUsername(String username); 15 | List findAll(); 16 | 17 | @Query("SELECT u FROM UserInfo u JOIN u.teams t WHERE t.id = :teamId") 18 | List getUsersByTeamId(@Param("teamId") Long teamId); 19 | 20 | Optional findByApiKey(String apiKey); 21 | // Add this method to your UserRepository interface 22 | @Query("SELECT COUNT(u) FROM UserInfo u JOIN u.teams t WHERE t.id = :teamId") 23 | int countUsersByTeamId(@Param("teamId") Long teamId); 24 | 25 | @Query("SELECT COUNT(u) FROM UserInfo u JOIN u.organizations o WHERE o.id = :organizationId") 26 | int countUsersByOrganizationId(@Param("organizationId") Long organizationId); 27 | 28 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/repository/UserRoleRepository.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.repository; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.UserRole; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | import java.util.Optional; 7 | 8 | public interface UserRoleRepository extends JpaRepository { 9 | Optional findByName(String name); 10 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/db/repository/VulnerabilityRepository.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.db.repository; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.Vulnerability; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | import java.util.Optional; 9 | 10 | @Repository 11 | public interface VulnerabilityRepository extends JpaRepository { 12 | Optional findByName(String name); 13 | 14 | List findByNameIn(List cveIds); 15 | } 16 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/backend/src/main/java/io/mixeway/mixewayflowapi/domain/.DS_Store -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/cloudscaninfo/CreateCloudScanInfoService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.cloudscaninfo; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.CloudSubscription; 4 | import io.mixeway.mixewayflowapi.db.entity.CloudScanInfo; 5 | import io.mixeway.mixewayflowapi.db.repository.CloudScanInfoRepository; 6 | import lombok.RequiredArgsConstructor; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.Optional; 10 | 11 | @Service 12 | @RequiredArgsConstructor 13 | public class CreateCloudScanInfoService { 14 | 15 | private final CloudScanInfoRepository cloudScanInfoRepository; 16 | 17 | public CloudScanInfo createOrUpdateCloudScanInfo(CloudSubscription cloudSubscription, CloudSubscription.ScanStatus scanStatus, int highFindings, int criticalFindings) { 18 | 19 | CloudScanInfo cloudScanInfo = new CloudScanInfo(cloudSubscription, scanStatus, highFindings, criticalFindings); 20 | 21 | return cloudScanInfoRepository.save(cloudScanInfo); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/cloudsubscriptionfindingstats/CreateCloudSubscriptionFindingStatsService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.cloudsubscriptionfindingstats; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.CloudSubscriptionFindingStats; 4 | import io.mixeway.mixewayflowapi.db.repository.CloudSubscriptionFindingStatsRepository; 5 | import lombok.RequiredArgsConstructor; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | @RequiredArgsConstructor 10 | public class CreateCloudSubscriptionFindingStatsService { 11 | private final CloudSubscriptionFindingStatsRepository cloudSubscriptionFindingStatsRepository; 12 | 13 | public void create(CloudSubscriptionFindingStats cloudSubscriptionFindingStats){ 14 | cloudSubscriptionFindingStatsRepository.save(cloudSubscriptionFindingStats); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/cloudsubscriptionfindingstats/FindCloudSubscriptionFindingStatsService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.cloudsubscriptionfindingstats; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.CloudSubscription; 4 | import io.mixeway.mixewayflowapi.db.entity.CloudSubscriptionFindingStats; 5 | import io.mixeway.mixewayflowapi.db.repository.CloudSubscriptionFindingStatsRepository; 6 | import lombok.RequiredArgsConstructor; 7 | import org.springframework.data.domain.PageRequest; 8 | import org.springframework.data.domain.Pageable; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | @Service 15 | @RequiredArgsConstructor 16 | public class FindCloudSubscriptionFindingStatsService { 17 | private final CloudSubscriptionFindingStatsRepository cloudSubscriptionFindingStatsRepository; 18 | 19 | public List getStatsForCloudSubscription(CloudSubscription cloudSubscription){ 20 | return cloudSubscriptionFindingStatsRepository.findTop14ByCloudSubscriptionOrderByDateInsertedDesc(cloudSubscription); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/coderepobranch/FindCodeRepoBranchService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.coderepobranch; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.CodeRepoBranch; 4 | import io.mixeway.mixewayflowapi.db.repository.CodeRepoBranchRepository; 5 | import lombok.RequiredArgsConstructor; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.Optional; 9 | 10 | @Service 11 | @RequiredArgsConstructor 12 | public class FindCodeRepoBranchService { 13 | private final CodeRepoBranchRepository codeRepoBranchRepository; 14 | 15 | public Optional findById(Long id){ 16 | return codeRepoBranchRepository.findById(id); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/coderepobranch/GetOrCreateCodeRepoBranchService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.coderepobranch; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.CodeRepo; 4 | import io.mixeway.mixewayflowapi.db.entity.CodeRepoBranch; 5 | import io.mixeway.mixewayflowapi.db.repository.CodeRepoBranchRepository; 6 | import lombok.RequiredArgsConstructor; 7 | import org.springframework.stereotype.Service; 8 | 9 | 10 | @Service 11 | @RequiredArgsConstructor 12 | public class GetOrCreateCodeRepoBranchService { 13 | private final CodeRepoBranchRepository codeRepoBranchRepository; 14 | 15 | public CodeRepoBranch getOrCreateCodeRepoBranch(String name, CodeRepo codeRepo){ 16 | return codeRepoBranchRepository.findByNameAndCodeRepo(name, codeRepo) 17 | .orElseGet(() -> createBranch(name, codeRepo)); 18 | } 19 | 20 | private CodeRepoBranch createBranch(String name, CodeRepo codeRepo) { 21 | return codeRepoBranchRepository.save(new CodeRepoBranch(name, codeRepo)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/coderepofindingstats/CreateCodeRepoFindingStatsService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.coderepofindingstats; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.CodeRepoFindingStats; 4 | import io.mixeway.mixewayflowapi.db.repository.CodeRepoFindingStatsRepository; 5 | import lombok.RequiredArgsConstructor; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | @RequiredArgsConstructor 10 | public class CreateCodeRepoFindingStatsService { 11 | private final CodeRepoFindingStatsRepository codeRepoFindingStatsRepository; 12 | 13 | public void create(CodeRepoFindingStats codeRepoFindingStats){ 14 | codeRepoFindingStatsRepository.save(codeRepoFindingStats); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/component/FindComponentService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.component; 2 | 3 | import io.mixeway.mixewayflowapi.api.components.dto.ComponentRawDataDto; 4 | import io.mixeway.mixewayflowapi.db.entity.CodeRepo; 5 | import io.mixeway.mixewayflowapi.db.entity.Component; 6 | import io.mixeway.mixewayflowapi.db.repository.ComponentRepository; 7 | import lombok.RequiredArgsConstructor; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | @Service 13 | @RequiredArgsConstructor 14 | public class FindComponentService { 15 | private final ComponentRepository componentRepository; 16 | 17 | public List findAll(){ 18 | return componentRepository.findAll(); 19 | } 20 | 21 | public List findComponentData(List accessibleRepos) { 22 | return componentRepository.findComponentData(accessibleRepos); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/repositoryallowlist/FindRepositoryAllowlistService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.repositoryallowlist; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.RepositoryAllowlist; 4 | import io.mixeway.mixewayflowapi.db.repository.RepositoryAllowlistRepository; 5 | import lombok.RequiredArgsConstructor; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | @RequiredArgsConstructor 10 | public class FindRepositoryAllowlistService { 11 | 12 | private final RepositoryAllowlistRepository repositoryAllowlistRepository; 13 | 14 | public Iterable findAll() { 15 | return repositoryAllowlistRepository.findAll(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/roles/FindRoleService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.roles; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.UserRole; 4 | import io.mixeway.mixewayflowapi.db.repository.UserRoleRepository; 5 | import io.mixeway.mixewayflowapi.exceptions.RoleNotExistingException; 6 | import lombok.RequiredArgsConstructor; 7 | import lombok.extern.log4j.Log4j2; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service 11 | @RequiredArgsConstructor 12 | @Log4j2 13 | public class FindRoleService { 14 | private final UserRoleRepository roleRepository; 15 | 16 | public UserRole findUserRole(String role) { 17 | return roleRepository.findByName(role) 18 | .orElseThrow(() -> new RoleNotExistingException("Role not existing: " + role)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/scaninfo/FindScanInfoService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.scaninfo; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.CodeRepo; 4 | import io.mixeway.mixewayflowapi.db.entity.ScanInfo; 5 | import io.mixeway.mixewayflowapi.db.repository.ScanInfoRepository; 6 | import lombok.RequiredArgsConstructor; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | @RequiredArgsConstructor 13 | public class FindScanInfoService { 14 | private final ScanInfoRepository scanInfoRepository; 15 | 16 | public List findScanInfoByRepo(CodeRepo repo){ 17 | return scanInfoRepository.findByCodeRepo(repo); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/settings/FindSettingsService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.settings; 2 | 3 | import io.mixeway.mixewayflowapi.api.admin.dto.AdditionalScannerConfigDto; 4 | import io.mixeway.mixewayflowapi.db.entity.Settings; 5 | import io.mixeway.mixewayflowapi.db.repository.SettingsRepository; 6 | import lombok.RequiredArgsConstructor; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | @RequiredArgsConstructor 11 | public class FindSettingsService { 12 | private final SettingsRepository settingsRepository; 13 | 14 | // ASUME Settings have only one row 15 | public Settings get(){ 16 | return settingsRepository.findAll().stream().findFirst().orElse(null); 17 | } 18 | 19 | public AdditionalScannerConfigDto getAdditionalScannerConfig() { 20 | Settings settings = get(); 21 | if (settings == null) { 22 | return new AdditionalScannerConfigDto(); // Returns default values (false) 23 | } 24 | return AdditionalScannerConfigDto.fromSettings(settings); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/suppressrule/DeleteSuppressRuleService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.suppressrule; 2 | 3 | import io.mixeway.mixewayflowapi.db.repository.SuppressRuleRepository; 4 | import lombok.RequiredArgsConstructor; 5 | import lombok.extern.log4j.Log4j2; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | @RequiredArgsConstructor 10 | @Log4j2 11 | public class DeleteSuppressRuleService { 12 | private final SuppressRuleRepository suppressRuleRepository; 13 | 14 | public void removeRule(Long id){ 15 | suppressRuleRepository.deleteById(id); 16 | log.info("[SuppressRule] Successfully deleted rule with id {}", id); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/suppressrule/FindSuppressRuleService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.suppressrule; 2 | 3 | import io.mixeway.mixewayflowapi.api.threatintel.dto.SuppressRuleResponseDTO; 4 | import io.mixeway.mixewayflowapi.db.entity.Team; 5 | import io.mixeway.mixewayflowapi.db.repository.SuppressRuleRepository; 6 | import lombok.RequiredArgsConstructor; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | import java.util.Set; 11 | 12 | @Service 13 | @RequiredArgsConstructor 14 | public class FindSuppressRuleService { 15 | private final SuppressRuleRepository suppressRuleRepository; 16 | 17 | public List suppressRuleResponseDTOS(Boolean isAdmin, Set userTeams){ 18 | return suppressRuleRepository.findAllAccessibleSuppressRules(isAdmin, userTeams); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/user/FindUserService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.user; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.UserInfo; 4 | import io.mixeway.mixewayflowapi.db.repository.UserRepository; 5 | import lombok.RequiredArgsConstructor; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.List; 9 | import java.util.Optional; 10 | 11 | 12 | @Service 13 | @RequiredArgsConstructor 14 | public class FindUserService { 15 | private final UserRepository userRepository; 16 | 17 | public UserInfo findUser(String username){ 18 | return userRepository.findByUsername(username); 19 | } 20 | public List findAll(){ return userRepository.findAll();} 21 | public Optional findById(Long id) { return userRepository.findById(id);} 22 | public Optional findByApiKey(String apiKey) { return userRepository.findByApiKey(apiKey);} 23 | } 24 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/vulnerability/FindVulnerabilityService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.vulnerability; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.Vulnerability; 4 | import io.mixeway.mixewayflowapi.db.repository.VulnerabilityRepository; 5 | import lombok.RequiredArgsConstructor; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.List; 9 | import java.util.Optional; 10 | 11 | @Service 12 | @RequiredArgsConstructor 13 | public class FindVulnerabilityService { 14 | private final VulnerabilityRepository vulnerabilityRepository; 15 | 16 | public List getAll(){ 17 | return vulnerabilityRepository.findAll().stream().toList(); 18 | } 19 | 20 | public Optional getById(Long id){ 21 | return vulnerabilityRepository.findById(id); 22 | } 23 | 24 | public Optional getByName(String name){ 25 | return vulnerabilityRepository.findByName(name); 26 | } 27 | 28 | public List getByNameIn(List cveIds) { 29 | return vulnerabilityRepository.findByNameIn(cveIds); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/domain/vulnerability/GetOrCreateVulnerabilityService.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.vulnerability; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.Finding; 4 | import io.mixeway.mixewayflowapi.db.entity.Vulnerability; 5 | import io.mixeway.mixewayflowapi.db.repository.VulnerabilityRepository; 6 | import io.mixeway.mixewayflowapi.exceptions.VulnerabilityException; 7 | import lombok.RequiredArgsConstructor; 8 | import org.springframework.stereotype.Service; 9 | import java.math.BigDecimal; 10 | 11 | @Service 12 | @RequiredArgsConstructor 13 | public class GetOrCreateVulnerabilityService { 14 | private final VulnerabilityRepository vulnerabilityRepository; 15 | 16 | public Vulnerability getOrCreate(String name, String desc, String refs, String reco, Finding.Severity severity, BigDecimal epssProbability, BigDecimal epssPercentile, Boolean hasExploit) { 17 | if (name == null) { 18 | throw new VulnerabilityException("Vulnerability name cannot be null"); 19 | } 20 | return vulnerabilityRepository.findByName(name) 21 | .orElseGet(() -> vulnerabilityRepository.save(new Vulnerability(name, desc, refs, reco, severity, epssProbability, epssPercentile, hasExploit))); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/CloudSubscriptionNotFoundException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class CloudSubscriptionNotFoundException extends RuntimeException { 4 | public CloudSubscriptionNotFoundException(String message) { 5 | super(message); 6 | } 7 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/CodeRepoNotFoundException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class CodeRepoNotFoundException extends RuntimeException { 4 | public CodeRepoNotFoundException(String message) { 5 | super(message); 6 | } 7 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/ComponentException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class ComponentException 4 | extends RuntimeException { 5 | public ComponentException(String errorMessage) { 6 | super(errorMessage); 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/DuplicateCloudSubscriptionException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class DuplicateCloudSubscriptionException extends RuntimeException { 4 | public DuplicateCloudSubscriptionException(String message) { 5 | super(message); 6 | } 7 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/FindingNotFoundException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class FindingNotFoundException extends Exception { 4 | 5 | public FindingNotFoundException() { 6 | super("Finding not found"); 7 | }} 8 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/GitException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class GitException 4 | extends InterruptedException { 5 | public GitException(String errorMessage) { 6 | super(errorMessage); 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/QuotaExceededException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class QuotaExceededException extends RuntimeException { 4 | public QuotaExceededException(String message) { 5 | super(message); 6 | } 7 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/RoleNotExistingException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class RoleNotExistingException 4 | extends RuntimeException { 5 | public RoleNotExistingException(String errorMessage) { 6 | super(errorMessage); 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/ScanException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class ScanException 4 | extends Exception { 5 | public ScanException(String errorMessage) { 6 | super(errorMessage); 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/SettingsException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class SettingsException 4 | extends Exception { 5 | public SettingsException(String errorMessage) { 6 | super(errorMessage); 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/TeamAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class TeamAlreadyExistsException 4 | extends RuntimeException { 5 | 6 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/TeamHasResourcesException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | /** 4 | * Exception thrown when attempting to delete a team that has associated resources 5 | */ 6 | public class TeamHasResourcesException extends RuntimeException { 7 | public TeamHasResourcesException(String message) { 8 | super(message); 9 | } 10 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/TeamNotFoundException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class TeamNotFoundException 4 | extends RuntimeException { 5 | 6 | public TeamNotFoundException(String errorMessage) { 7 | super(errorMessage); 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/UnauthorizedAccessException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class UnauthorizedAccessException extends RuntimeException { 4 | public UnauthorizedAccessException(String message) { 5 | super(message); 6 | } 7 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/UnauthorizedException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class UnauthorizedException 4 | extends RuntimeException { 5 | 6 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/UserAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class UserAlreadyExistsException 4 | extends RuntimeException { 5 | public UserAlreadyExistsException(String errorMessage) { 6 | super(errorMessage); 7 | } 8 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/UserNotExistingException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class UserNotExistingException 4 | extends RuntimeException { 5 | 6 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/exceptions/VulnerabilityException.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.exceptions; 2 | 3 | public class VulnerabilityException 4 | extends RuntimeException { 5 | public VulnerabilityException(String errorMessage) { 6 | super(errorMessage); 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/repo/dto/CommentMessage.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.repo.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CommentMessage { 7 | String body; 8 | } 9 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/repo/dto/ImportCodeRepoGitHubResponseDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.repo.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | @Getter 8 | @Setter 9 | public class ImportCodeRepoGitHubResponseDto { 10 | private int id; 11 | private String description; 12 | @JsonProperty("default_branch") 13 | private String defaultBranch; 14 | @JsonProperty("html_url") 15 | private String webUrl; 16 | @JsonProperty("full_name") 17 | private String pathWithNamespace; 18 | } 19 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/repo/dto/ImportCodeRepoResponseDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.repo.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | @Getter 8 | @Setter 9 | public class ImportCodeRepoResponseDto { 10 | private int id; 11 | private String description; 12 | @JsonProperty("default_branch") 13 | private String defaultBranch; 14 | @JsonProperty("web_url") 15 | private String webUrl; 16 | @JsonProperty("path_with_namespace") 17 | private String pathWithNamespace; 18 | } 19 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/scanner/cloud_scanner/dto/ProjectExternalNameResponse.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.scanner.cloud_scanner.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | @Getter 8 | @Setter 9 | public class ProjectExternalNameResponse { 10 | @JsonProperty("data") 11 | private ProjectData data; 12 | 13 | @Getter 14 | @Setter 15 | public static class ProjectData { 16 | @JsonProperty("project") 17 | private Project project; 18 | } 19 | 20 | @Getter 21 | @Setter 22 | public static class Project { 23 | @JsonProperty("name") 24 | private String externalProjectName; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/scanner/sast/dto/BearerScanSecurity.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.scanner.sast.dto; 2 | 3 | import lombok.Data; 4 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 | 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class BearerScanSecurity { 12 | private List critical; 13 | private List high; 14 | private List medium; 15 | private List low; 16 | } 17 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/scanner/sast/dto/CodeLocation.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.scanner.sast.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import lombok.Data; 5 | 6 | @Data 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public class CodeLocation { 9 | private int start; 10 | private int end; 11 | private Column column; 12 | } -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/scanner/sast/dto/Column.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.scanner.sast.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | @Data 9 | @JsonIgnoreProperties(ignoreUnknown = true) 10 | @AllArgsConstructor 11 | @NoArgsConstructor 12 | public class Column { 13 | private int start; 14 | private int end; 15 | } 16 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/scanner/sast/dto/Item.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.scanner.sast.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | @JsonIgnoreProperties(ignoreUnknown = true) 11 | public class Item { 12 | private String id; 13 | private String title; 14 | private String description; 15 | @JsonProperty("documentation_url") 16 | private String documentationUrl; 17 | @JsonProperty("line_number") 18 | private int lineNumber; 19 | @JsonProperty("full_filename") 20 | private String fullFilename; 21 | private String filename; 22 | @JsonProperty("category_groups") 23 | private List categoryGroups; 24 | private CodeLocation source; 25 | private CodeLocation sink; 26 | @JsonProperty("parent_line_number") 27 | private int parentLineNumber; 28 | private String fingerprint; 29 | @JsonProperty("old_fingerprint") 30 | private String oldFingerprint; 31 | @JsonProperty("code_extract") 32 | private String codeExtract; 33 | } 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/scanner/sca/apiclient/KEVApiClient.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.scanner.sca.apiclient; 2 | 3 | import io.mixeway.mixewayflowapi.integrations.scanner.sca.dto.CatalogDto; 4 | import lombok.RequiredArgsConstructor; 5 | import lombok.extern.log4j.Log4j2; 6 | import org.springframework.core.ParameterizedTypeReference; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.web.reactive.function.client.WebClient; 9 | import reactor.core.publisher.Mono; 10 | 11 | import java.util.HashMap; 12 | 13 | @Service 14 | @RequiredArgsConstructor 15 | @Log4j2 16 | public class KEVApiClient { 17 | private final WebClient webClient; 18 | 19 | public Mono loadKev() { 20 | 21 | return webClient.get() 22 | .uri("https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json") 23 | .retrieve() 24 | .bodyToMono(CatalogDto.class); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/scanner/sca/dto/CreateProjectRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.scanner.sca.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class CreateProjectRequestDto { 11 | String name; 12 | } 13 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/scanner/sca/dto/CreateProjectResponseDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.scanner.sca.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import lombok.Data; 5 | 6 | @Data 7 | @JsonIgnoreProperties(ignoreUnknown = true) 8 | public class CreateProjectResponseDto { 9 | String name; 10 | String classifier; 11 | String uuid; 12 | } 13 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/scanner/sca/dto/DTrackGetVulnResponseDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.scanner.sca.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import lombok.Data; 5 | 6 | import java.math.BigDecimal; 7 | import java.sql.Timestamp; 8 | import java.util.List; 9 | 10 | @Data 11 | @JsonIgnoreProperties(ignoreUnknown = true) 12 | public class DTrackGetVulnResponseDto { 13 | private String vulnId; 14 | private String source; 15 | private String description; 16 | private Timestamp published; 17 | private String recommendation; 18 | private String references; 19 | private String Severity; 20 | private BigDecimal epssScore; 21 | private BigDecimal epssPercentile; 22 | private List components; 23 | 24 | @Data 25 | @JsonIgnoreProperties(ignoreUnknown = true) 26 | public static class Component{ 27 | private String group; 28 | private String name; 29 | private String version; 30 | private String description; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/scanner/sca/dto/GetApiKeyResponseDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.scanner.sca.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import lombok.Data; 5 | import lombok.Getter; 6 | 7 | import java.util.List; 8 | 9 | @Getter 10 | @Data 11 | @JsonIgnoreProperties(ignoreUnknown = true) 12 | public class GetApiKeyResponseDto { 13 | 14 | @Data 15 | @JsonIgnoreProperties(ignoreUnknown = true) 16 | public static class ResponseObject { 17 | private String uuid; 18 | private String name; 19 | private List apiKeys; 20 | 21 | @Data 22 | @JsonIgnoreProperties(ignoreUnknown = true) 23 | public static class ApiKey { 24 | private String key; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/integrations/scanner/sca/dto/SendBomRequestDto.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.integrations.scanner.sca.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class SendBomRequestDto { 11 | String project; 12 | String bom; 13 | } 14 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/utils/DTO.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.utils; 2 | 3 | public interface DTO { 4 | } 5 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/utils/DtoValidator.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.utils; 2 | 3 | import io.mixeway.mixewayflowapi.api.team.dto.ChangeTeamRequestDto; 4 | 5 | public class DtoValidator { 6 | 7 | public static void validate(DTO dto) { 8 | var factory = jakarta.validation.Validation.buildDefaultValidatorFactory(); 9 | var validator = factory.getValidator(); 10 | var violations = validator.validate(dto); 11 | 12 | if (!violations.isEmpty()) { 13 | StringBuilder sb = new StringBuilder(); 14 | for (var violation : violations) { 15 | sb.append(violation.getMessage()).append("\n"); 16 | } 17 | throw new IllegalArgumentException(sb.toString()); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/utils/Role.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.utils; 2 | 3 | public enum Role { 4 | ADMIN, 5 | USER, 6 | TEAM_MANAGER 7 | } 8 | -------------------------------------------------------------------------------- /backend/src/main/java/io/mixeway/mixewayflowapi/utils/StatusDTO.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.utils; 2 | 3 | 4 | import lombok.Data; 5 | 6 | @Data 7 | public class StatusDTO { 8 | private String status; 9 | 10 | public StatusDTO(String status){ 11 | this.status = status; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /backend/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:postgresql://localhost:5432/flow 2 | spring.datasource.username=${DB_USER:flow_user} 3 | spring.datasource.password=${DB_PASS:flow_pass} 4 | spring.datasource.driver-class-name=org.postgresql.Driver 5 | 6 | 7 | server.port=8888 8 | # Hibernate settings 9 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect 10 | spring.jpa.hibernate.ddl-auto=none 11 | 12 | 13 | # connection timeout 14 | spring.datasource.hikari.connection-timeout=20000 15 | # min idle connections 16 | spring.datasource.hikari.minimum-idle=5 17 | # max pool size 18 | spring.datasource.hikari.maximum-pool-size=12 19 | spring.datasource.hikari.idle-timeout=300000 20 | spring.datasource.hikari.max-lifetime=1200000 21 | spring.datasource.hikari.auto-commit=true 22 | #logging.level.root = DEBUG 23 | spring.codec.max-in-memory-size=30MB 24 | 25 | spring.liquibase.change-log=classpath:db/changelog/db.changelog-master.sql 26 | spring.liquibase.enabled=true 27 | 28 | kics.queries.dir=/opt/tools/kics/assets/queries 29 | bearer.queries.dir=/opt/bearer/rules 30 | dependency-track.url=http://127.0.0.1:8080 31 | spring.jackson.write-nesting-depth=2000 32 | frontend.url="localhost" -------------------------------------------------------------------------------- /backend/src/main/resources/application-ut.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:tc:postgresql:15.1:///test 2 | spring.datasource.username=test 3 | spring.datasource.password=test 4 | spring.datasource.driver-class-name=org.testcontainers.jdbc.ContainerDatabaseDriver 5 | 6 | 7 | 8 | server.port=8888 9 | # Hibernate settings 10 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect 11 | spring.jpa.hibernate.ddl-auto=none 12 | 13 | # connection timeout 14 | spring.datasource.hikari.connection-timeout=20000 15 | # min idle connections 16 | spring.datasource.hikari.minimum-idle=5 17 | # max pool size 18 | spring.datasource.hikari.maximum-pool-size=12 19 | spring.datasource.hikari.idle-timeout=300000 20 | spring.datasource.hikari.max-lifetime=1200000 21 | spring.datasource.hikari.auto-commit=true 22 | #logging.level.root = DEBUG 23 | 24 | spring.liquibase.change-log=classpath:db/changelog/test.changelog.yaml 25 | 26 | 27 | kics.queries.dir=/opt/tools/kics/assets/queries 28 | bearer.queries.dir= 29 | dependency-track.url=http://127.0.0.1:8080 30 | spring.jackson.write-nesting-depth=2000 31 | frontend.url=test -------------------------------------------------------------------------------- /backend/src/main/resources/db/changelog/test.changelog.yaml: -------------------------------------------------------------------------------- 1 | databaseChangeLog: 2 | - changeSet: 3 | id: 1 4 | author: siewer 5 | changes: 6 | - sqlFile: 7 | path: "classpath:db/changelog/db.changelog-master.sql" 8 | splitStatements: true 9 | stripComments: true 10 | 11 | - changeSet: 12 | id: 2 13 | author: siewer 14 | changes: 15 | - sqlFile: 16 | path: "classpath:db/changelog/data_dump_test.sql" 17 | splitStatements: true 18 | stripComments: true -------------------------------------------------------------------------------- /backend/src/test/java/io/mixeway/mixewayflowapi/config/TestConfig.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.config; 2 | 3 | import io.mixeway.mixewayflowapi.db.entity.CodeRepo; 4 | import io.mixeway.mixewayflowapi.db.entity.Settings; 5 | import io.mixeway.mixewayflowapi.integrations.scanner.sca.apiclient.DependencyTrackApiClientService; 6 | import lombok.RequiredArgsConstructor; 7 | import org.springframework.boot.test.context.TestConfiguration; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Primary; 10 | 11 | 12 | 13 | import static org.mockito.Mockito.*; 14 | import static org.mockito.Mockito.mock; 15 | 16 | @TestConfiguration 17 | @RequiredArgsConstructor 18 | public class TestConfig { 19 | 20 | @Bean 21 | @Primary 22 | public DependencyTrackApiClientService dependencyTrackApiClientService() { 23 | DependencyTrackApiClientService dependencyTrackApiClientService = mock(DependencyTrackApiClientService.class); 24 | doNothing().when(dependencyTrackApiClientService).createProject(any(Settings.class), any(CodeRepo.class)); 25 | return dependencyTrackApiClientService; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /backend/src/test/java/io/mixeway/mixewayflowapi/domain/team/CreateTeamServiceTest.java: -------------------------------------------------------------------------------- 1 | package io.mixeway.mixewayflowapi.domain.team; 2 | 3 | import io.mixeway.mixewayflowapi.config.TestConfig; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.mockito.Mock; 7 | import org.mockito.Mockito; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.boot.test.context.SpringBootTest; 10 | import org.springframework.context.annotation.Import; 11 | import org.springframework.test.context.ActiveProfiles; 12 | import org.springframework.test.context.junit4.SpringRunner; 13 | 14 | import java.security.Principal; 15 | import java.util.ArrayList; 16 | 17 | 18 | @SpringBootTest 19 | @RunWith(SpringRunner.class) 20 | @ActiveProfiles("ut") 21 | @Import(TestConfig.class) 22 | public class CreateTeamServiceTest { 23 | @Autowired 24 | CreateTeamService createTeamService; 25 | @Mock 26 | Principal principal; 27 | 28 | @Test 29 | public void createTeam() { 30 | Mockito.when(principal.getName()).thenReturn("admin"); 31 | createTeamService.createTeam("test","test", new ArrayList<>(), principal); 32 | } 33 | } -------------------------------------------------------------------------------- /dev/Dockerfile: -------------------------------------------------------------------------------- 1 | # Use the official Nginx image from the Docker Hub 2 | FROM nginx:alpine 3 | 4 | # Copy the custom Nginx configuration file to the container 5 | COPY nginx-dev.conf /etc/nginx/nginx.conf 6 | 7 | # Expose port 80 to the host 8 | EXPOSE 80 -------------------------------------------------------------------------------- /dev/nginx-dev.conf: -------------------------------------------------------------------------------- 1 | events { } 2 | http { 3 | server { 4 | listen 80; 5 | 6 | server_name localhost; 7 | 8 | # Serve Angular frontend 9 | location / { 10 | proxy_pass http://host.docker.internal:4200; 11 | proxy_set_header Host $host; 12 | proxy_set_header X-Real-IP $remote_addr; 13 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 14 | proxy_set_header X-Forwarded-Proto $scheme; 15 | } 16 | 17 | # Proxy requests to Spring Boot backend 18 | location /api/ { 19 | proxy_pass http://host.docker.internal:8888/api/; 20 | proxy_set_header Host $host; 21 | proxy_set_header X-Real-IP $remote_addr; 22 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 23 | proxy_set_header X-Forwarded-Proto $scheme; 24 | } 25 | 26 | location /oauth2/ { 27 | proxy_pass http://host.docker.internal:8888/oauth2/; 28 | proxy_set_header Host $host; 29 | proxy_set_header X-Real-IP $remote_addr; 30 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 31 | proxy_set_header X-Forwarded-Proto $scheme; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /frontend/Dockerfile: -------------------------------------------------------------------------------- 1 | # Stage 1: Build Angular Application 2 | FROM node:18-alpine as build 3 | 4 | WORKDIR /app 5 | 6 | # Install build dependencies 7 | RUN apk add --no-cache python3 make g++ 8 | 9 | 10 | # Copy package.json and package-lock.json 11 | COPY package.json ./ 12 | 13 | # Install dependencies 14 | RUN npm install --legacy-peer-deps 15 | 16 | # Copy Angular application code 17 | COPY . . 18 | 19 | # Build the Angular application with the production environment 20 | RUN npm run build -- --configuration production --output-path=dist 21 | 22 | # Stage 2: Setup Nginx and SSL 23 | FROM nginx:alpine 24 | 25 | # Install OpenSSL 26 | RUN apk add --no-cache openssl 27 | 28 | RUN rm -rf /usr/share/nginx/html/* 29 | 30 | 31 | # Copy the build output to the Nginx web directory 32 | COPY --from=build /app/dist /usr/share/nginx/html 33 | 34 | # Copy a custom Nginx configuration file 35 | COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf 36 | 37 | # Entry point script to handle SSL key generation and verification 38 | COPY entrypoint.sh /entrypoint.sh 39 | RUN chmod +x /entrypoint.sh 40 | 41 | # Expose port 443 for HTTPS 42 | EXPOSE 443 43 | 44 | # Run the entrypoint script 45 | ENTRYPOINT ["/entrypoint.sh"] 46 | -------------------------------------------------------------------------------- /frontend/README.md: -------------------------------------------------------------------------------- 1 | ## How to Run: 2 | 3 | ```shell 4 | git clone https://github.com/mixeway/flow 5 | cd flow 6 | npm install 7 | npm start 8 | ``` 9 | 10 | ### Communication to backend 11 | - in current release all communication to backend is done via src/app/service* 12 | - all Services have hardcoded line: `private loginUrl = 'http://lh1:8080'; // Replace with your backend URL` 13 | - make sure to add lh1 in `/etc/hosts` pointing for backend address (in most of dev cases it would be 127.0.0.1) 14 | 15 | 16 | ### ARM 17 | arm image is with `latest-arm` tag 18 | -------------------------------------------------------------------------------- /frontend/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SSL_DIR="/etc/nginx/ssl" 4 | PRIVATE_KEY="$SSL_DIR/private.key" 5 | PUBLIC_KEY="$SSL_DIR/public.crt" 6 | 7 | # Create the SSL directory if it doesn't exist 8 | mkdir -p $SSL_DIR 9 | 10 | # Function to generate SSL keys 11 | generate_keys() { 12 | echo "Generating new private and public key..." 13 | openssl req -newkey rsa:4096 -nodes -keyout $PRIVATE_KEY -x509 -days 365 -out $PUBLIC_KEY -subj "/C=US/ST=State/L=City/O=Organization/OU=OrgUnit/CN=localhost" 14 | } 15 | 16 | # Check if both private and public keys exist 17 | if [ -f "$PRIVATE_KEY" ] && [ -f "$PUBLIC_KEY" ]; then 18 | echo "Both private and public keys exist. Verifying if they match..." 19 | 20 | # Extract modulus from both keys and compare 21 | PRIVATE_MODULUS=$(openssl rsa -noout -modulus -in $PRIVATE_KEY | openssl md5) 22 | PUBLIC_MODULUS=$(openssl x509 -noout -modulus -in $PUBLIC_KEY | openssl md5) 23 | 24 | if [ "$PRIVATE_MODULUS" != "$PUBLIC_MODULUS" ]; then 25 | echo "Keys do not match. Generating new keys..." 26 | generate_keys 27 | else 28 | echo "Keys match. Using existing keys." 29 | fi 30 | else 31 | echo "Keys are missing. Generating new keys..." 32 | generate_keys 33 | fi 34 | 35 | # Start Nginx 36 | echo "Starting Nginx with SSL configuration..." 37 | nginx -g 'daemon off;' 38 | -------------------------------------------------------------------------------- /frontend/frontend.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /frontend/nginx/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api": { 3 | "target": "http://localhost:8888", 4 | "secure": false, 5 | "changeOrigin": true, 6 | "pathRewrite": { "^/api": "/api" } 7 | }, 8 | "/oauth2": { 9 | "target": "http://localhost:8888", 10 | "secure": false, 11 | "changeOrigin": true, 12 | "pathRewrite": { "^/oauth2": "/oauth2" } 13 | } 14 | } -------------------------------------------------------------------------------- /frontend/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule, 10 | AppComponent 11 | ], 12 | }).compileComponents(); 13 | }); 14 | 15 | it('should create the app', () => { 16 | const fixture = TestBed.createComponent(AppComponent); 17 | const app = fixture.componentInstance; 18 | expect(app).toBeTruthy(); 19 | }); 20 | 21 | it(`should have as title 'CoreUI Angular Admin Template'`, () => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | const app = fixture.componentInstance; 24 | expect(app.title).toEqual('CoreUI Angular Admin Template'); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /frontend/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { NavigationEnd, Router, RouterOutlet } from '@angular/router'; 3 | import { Title } from '@angular/platform-browser'; 4 | 5 | import { IconSetService } from '@coreui/icons-angular'; 6 | import { iconSubset } from './icons/icon-subset'; 7 | 8 | 9 | @Component({ 10 | selector: 'app-root', 11 | template: '', 12 | standalone: true, 13 | imports: [RouterOutlet] 14 | }) 15 | export class AppComponent implements OnInit { 16 | title = 'Mixeway Flow'; 17 | 18 | constructor( 19 | private router: Router, 20 | private titleService: Title, 21 | private iconSetService: IconSetService 22 | ) { 23 | this.titleService.setTitle(this.title); 24 | // iconSet singleton 25 | this.iconSetService.icons = { ...iconSubset }; 26 | } 27 | 28 | ngOnInit(): void { 29 | this.router.events.subscribe((evt) => { 30 | if (!(evt instanceof NavigationEnd)) { 31 | return; 32 | } 33 | }); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /frontend/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, importProvidersFrom } from '@angular/core'; 2 | import { provideAnimations } from '@angular/platform-browser/animations'; 3 | import { 4 | provideRouter, 5 | withEnabledBlockingInitialNavigation, 6 | withHashLocation, 7 | withInMemoryScrolling, 8 | withRouterConfig, 9 | withViewTransitions 10 | } from '@angular/router'; 11 | 12 | import { DropdownModule, SidebarModule } from '@coreui/angular'; 13 | import { IconSetService } from '@coreui/icons-angular'; 14 | import { routes } from './app.routes'; 15 | import {provideHttpClient} from "@angular/common/http"; 16 | 17 | export const appConfig: ApplicationConfig = { 18 | providers: [ 19 | provideRouter(routes, 20 | withRouterConfig({ 21 | onSameUrlNavigation: 'reload' 22 | }), 23 | withInMemoryScrolling({ 24 | scrollPositionRestoration: 'top', 25 | anchorScrolling: 'enabled' 26 | }), 27 | withEnabledBlockingInitialNavigation(), 28 | withViewTransitions(), 29 | withHashLocation() 30 | ), 31 | importProvidersFrom(SidebarModule, DropdownModule), 32 | IconSetService, 33 | provideAnimations(), 34 | provideHttpClient() 35 | ] 36 | }; 37 | -------------------------------------------------------------------------------- /frontend/src/app/icons/signet.ts: -------------------------------------------------------------------------------- 1 | export const signet = [ 2 | '102 115', 3 | ` 4 | 5 | 6 | `, 7 | ] 8 | 9 | -------------------------------------------------------------------------------- /frontend/src/app/layout/default-layout/default-footer/default-footer.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | Mixeway Flow 4 | © 2024 Mixeway Security 5 |
6 | 7 | 8 | -------------------------------------------------------------------------------- /frontend/src/app/layout/default-layout/default-footer/default-footer.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/app/layout/default-layout/default-footer/default-footer.component.scss -------------------------------------------------------------------------------- /frontend/src/app/layout/default-layout/default-footer/default-footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DefaultFooterComponent } from './default-footer.component'; 4 | 5 | describe('DefaultFooterComponent', () => { 6 | let component: DefaultFooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [DefaultFooterComponent] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DefaultFooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /frontend/src/app/layout/default-layout/default-footer/default-footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { FooterComponent } from '@coreui/angular'; 3 | 4 | @Component({ 5 | selector: 'app-default-footer', 6 | templateUrl: './default-footer.component.html', 7 | styleUrls: ['./default-footer.component.scss'], 8 | standalone: true, 9 | }) 10 | export class DefaultFooterComponent extends FooterComponent { 11 | constructor() { 12 | super(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /frontend/src/app/layout/default-layout/default-header/default-header.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/app/layout/default-layout/default-header/default-header.component.scss -------------------------------------------------------------------------------- /frontend/src/app/layout/default-layout/default-layout.component.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | .ng-scrollbar { 3 | --scrollbar-padding: 1px; 4 | --scrollbar-size: 5px; 5 | --scrollbar-thumb-color: var(--cui-gray-500, #999); 6 | --scrollbar-thumb-hover-color: var(--cui-gray-400, #999); 7 | --scrollbar-hover-size: calc(var(--scrollbar-size) * 1.5); 8 | } 9 | } 10 | 11 | // ng-scrollbar css variables 12 | //.cui-scrollbar { 13 | // --scrollbar-border-radius: 7px; 14 | // --scrollbar-padding: 1px; 15 | // --scrollbar-viewport-margin: 0; 16 | // --scrollbar-track-color: transparent; 17 | // --scrollbar-wrapper-color: transparent; 18 | // --scrollbar-thumb-color: rgba(0, 0, 0, 0.2); 19 | // --scrollbar-thumb-hover-color: var(--scrollbar-thumb-color); 20 | // --scrollbar-size: 5px; 21 | // --scrollbar-hover-size: var(--scrollbar-size); 22 | // --scrollbar-thumb-transition: height ease-out 150ms, width ease-out 150ms; 23 | // --scrollbar-track-transition: height ease-out 150ms, width ease-out 150ms; 24 | //} 25 | -------------------------------------------------------------------------------- /frontend/src/app/layout/default-layout/index.ts: -------------------------------------------------------------------------------- 1 | export * from './default-footer/default-footer.component'; 2 | export * from './default-header/default-header.component'; 3 | export * from './default-layout.component'; 4 | -------------------------------------------------------------------------------- /frontend/src/app/layout/index.ts: -------------------------------------------------------------------------------- 1 | export * from './default-layout'; 2 | -------------------------------------------------------------------------------- /frontend/src/app/model/FindingDTO.ts: -------------------------------------------------------------------------------- 1 | export class FindingDTO { 2 | id: number = 0; 3 | name: string = ""; 4 | location: string = ""; 5 | source: string = ""; 6 | status: string = ""; 7 | severity: string = ""; 8 | inserted: string = ""; 9 | last_seen: string= ""; 10 | } 11 | interface Comment { 12 | inserted: string; 13 | message: string; 14 | author: string; 15 | } 16 | 17 | export class SingleFindingDTO { 18 | vulnsResponseDto: FindingDTO | undefined; 19 | description: string = ""; 20 | recommendation: string = ""; 21 | explanation: string = ""; 22 | refs:string = ""; 23 | comments: Comment[] = []; 24 | } -------------------------------------------------------------------------------- /frontend/src/app/model/FindingSourceStatDTO.ts: -------------------------------------------------------------------------------- 1 | export class FindingSourceStatDTO { 2 | sast: number = 0; 3 | iac: number = 0; 4 | secrets: number = 0; 5 | sca: number = 0; 6 | gitlab: number = 0; 7 | } -------------------------------------------------------------------------------- /frontend/src/app/model/TeamFindingSourceStatDTO.ts: -------------------------------------------------------------------------------- 1 | export class TeamFindingSourceStatDTO { 2 | sast: number = 0; 3 | iac: number = 0; 4 | secrets: number = 0; 5 | sca: number = 0; 6 | gitlab: number = 0; 7 | cloud: number = 0; 8 | } -------------------------------------------------------------------------------- /frontend/src/app/service/AppConfigService.ts: -------------------------------------------------------------------------------- 1 | // app-config.service.ts 2 | import { Injectable } from '@angular/core'; 3 | import { HttpClient } from '@angular/common/http'; 4 | import { Observable } from 'rxjs'; 5 | 6 | @Injectable({ 7 | providedIn: 'root' 8 | }) 9 | export class AppConfigService { 10 | private baseUrl = '/api/v1/admin/config'; 11 | 12 | constructor(private http: HttpClient) { } 13 | 14 | getRunMode(): Observable { 15 | return this.http.get(`${this.baseUrl}/runmode`); 16 | } 17 | 18 | setRunMode(mode: string): Observable { 19 | return this.http.post(`${this.baseUrl}/runmode`, { mode }); 20 | } 21 | 22 | getAppModeInfo(): Observable { 23 | return this.http.get('/api/v1/user/app-info'); 24 | } 25 | } -------------------------------------------------------------------------------- /frontend/src/app/service/CloudService.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { Observable } from 'rxjs'; 4 | import { environment } from "../../environments/environment"; 5 | 6 | interface CloudSubscription { 7 | id: number; 8 | name: string; 9 | team: string; 10 | externalProjectName: string; 11 | cloudSubscription: string; 12 | scanStatus: string; 13 | } 14 | 15 | @Injectable({ 16 | providedIn: 'root' 17 | }) 18 | export class CloudService { 19 | private loginUrl = environment.backendUrl; 20 | 21 | constructor(private http: HttpClient) {} 22 | 23 | getCloudSubscriptions(): Observable { 24 | return this.http.get(this.loginUrl + '/api/v1/cloudsubscription/cloudsubscriptions', { withCredentials: true }); 25 | } 26 | 27 | getAggregatedStats(): Observable { 28 | return this.http.get(this.loginUrl + '/api/v1/widget_stats', { withCredentials: true }); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /frontend/src/app/service/ComponentsService.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { Observable } from 'rxjs'; 4 | import {environment} from "../../environments/environment"; 5 | 6 | 7 | @Injectable({ 8 | providedIn: 'root' 9 | }) 10 | export class ComponentsService { 11 | private loginUrl = environment.backendUrl; 12 | 13 | 14 | constructor(private http: HttpClient) {} 15 | 16 | getComponents(): Observable { 17 | return this.http.get(this.loginUrl + '/api/v1/components',{ withCredentials: true }); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /frontend/src/app/service/TeamService.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { Observable } from 'rxjs'; 4 | import {environment} from "../../environments/environment"; 5 | 6 | interface TeamDto { 7 | name: string; 8 | users: number[]; 9 | } 10 | interface ChangeTeamDto { 11 | id: number; 12 | users: number[]; 13 | } 14 | @Injectable({ 15 | providedIn: 'root' 16 | }) 17 | export class TeamService { 18 | private loginUrl = environment.backendUrl; 19 | 20 | 21 | constructor(private http: HttpClient) {} 22 | 23 | create(team: TeamDto): Observable { 24 | return this.http.post(this.loginUrl + '/api/v1/team/create', team, { withCredentials: true }); 25 | } 26 | get(): Observable { 27 | return this.http.get(this.loginUrl + '/api/v1/team',{ withCredentials: true }); 28 | } 29 | 30 | getTeam(id: string): Observable { 31 | return this.http.get(this.loginUrl + '/api/v1/team/' + id ,{ withCredentials: true }); 32 | } 33 | update(change: ChangeTeamDto): Observable { 34 | return this.http.post(this.loginUrl + '/api/v1/team', change, { withCredentials: true }); 35 | } 36 | delete(id: number): Observable { 37 | return this.http.delete(`/api/v1/team/${id}`); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /frontend/src/app/service/VulnerabilityService.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { Observable } from 'rxjs'; 4 | import {environment} from "../../environments/environment"; 5 | 6 | 7 | @Injectable({ 8 | providedIn: 'root' 9 | }) 10 | export class VulnerabilityService { 11 | private loginUrl = environment.backendUrl; 12 | 13 | constructor(private http: HttpClient) {} 14 | 15 | getVulnerabilities(): Observable { 16 | return this.http.get(this.loginUrl + '/api/v1/vulnerabilities',{ withCredentials: true }); 17 | } 18 | patchVuln(vuln: any): Observable { 19 | return this.http.post(this.loginUrl + '/api/v1/vulnerability',vuln,{ withCredentials: true }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /frontend/src/app/utils/GitRepoUrlValidator.ts: -------------------------------------------------------------------------------- 1 | import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms'; 2 | 3 | export function gitRepoUrlValidator(): ValidatorFn { 4 | return (control: AbstractControl): ValidationErrors | null => { 5 | const url = control.value; 6 | try { 7 | const parsedUrl = new URL(url); 8 | 9 | // Check if the URL has a host and a path 10 | if (parsedUrl.host && parsedUrl.pathname && parsedUrl.pathname !== '/') { 11 | // Optional: Further validation to check if the URL has a port 12 | return null; 13 | } else { 14 | return { invalidGitRepoUrl: true }; 15 | } 16 | } catch (e) { 17 | return { invalidGitRepoUrl: true }; 18 | } 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /frontend/src/app/views/admin-settings/admin-settings.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminSettingsComponent } from './admin-settings.component'; 4 | 5 | describe('AdminSettingsComponent', () => { 6 | let component: AdminSettingsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [AdminSettingsComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(AdminSettingsComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/admin-settings/routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | import {AdminSettingsComponent} from "./admin-settings.component"; 3 | 4 | 5 | export const routes: Routes = [ 6 | { 7 | path: '', 8 | component: AdminSettingsComponent, 9 | data: { 10 | title: 'Admin Settings' 11 | } 12 | }, 13 | { 14 | path: '', 15 | component: AdminSettingsComponent, 16 | data: { 17 | title: 'Admin Settings' 18 | } 19 | } 20 | ]; 21 | -------------------------------------------------------------------------------- /frontend/src/app/views/admin-users/admin-users.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminUsersComponent } from './admin-users.component'; 4 | 5 | describe('AdminUsersComponent', () => { 6 | let component: AdminUsersComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [AdminUsersComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(AdminUsersComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/admin-users/routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | import {AdminUsersComponent} from "./admin-users.component"; 3 | 4 | 5 | export const routes: Routes = [ 6 | { 7 | path: '', 8 | component: AdminUsersComponent, 9 | data: { 10 | title: 'Admin User Management' 11 | } 12 | } 13 | ]; 14 | -------------------------------------------------------------------------------- /frontend/src/app/views/components/components.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/app/views/components/components.component.scss -------------------------------------------------------------------------------- /frontend/src/app/views/components/components.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ComponentsComponent } from './components.component'; 4 | 5 | describe('ComponentsComponent', () => { 6 | let component: ComponentsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [ComponentsComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ComponentsComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/components/routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | import {ComponentsComponent} from "./components.component"; 3 | 4 | 5 | export const routes: Routes = [ 6 | { 7 | path: '', 8 | component: ComponentsComponent, 9 | data: { 10 | title: 'Components' 11 | } 12 | } 13 | ]; 14 | -------------------------------------------------------------------------------- /frontend/src/app/views/dashboard/routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | export const routes: Routes = [ 4 | { 5 | path: '', 6 | loadComponent: () => import('./dashboard.component').then(m => m.DashboardComponent), 7 | data: { 8 | title: $localize`Dashboard` 9 | } 10 | } 11 | ]; 12 | 13 | -------------------------------------------------------------------------------- /frontend/src/app/views/manage-teams/manage-teams.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ManageTeamsComponent } from './manage-teams.component'; 4 | 5 | describe('ManageTeamsComponent', () => { 6 | let component: ManageTeamsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [ManageTeamsComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ManageTeamsComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/manage-teams/routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | import {ManageTeamsComponent} from "./manage-teams.component"; 3 | 4 | 5 | export const routes: Routes = [ 6 | { 7 | path: '', 8 | component: ManageTeamsComponent, 9 | data: { 10 | title: 'Manage Teams' 11 | } 12 | } 13 | ]; 14 | -------------------------------------------------------------------------------- /frontend/src/app/views/pages/change-password/change-password.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ChangePasswordComponent } from './change-password.component'; 4 | 5 | describe('ChangePasswordComponent', () => { 6 | let component: ChangePasswordComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [ChangePasswordComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ChangePasswordComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/pages/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ButtonModule, CardModule, FormModule, GridModule } from '@coreui/angular'; 4 | import { LoginComponent } from './login.component'; 5 | import { IconModule } from '@coreui/icons-angular'; 6 | import { IconSetService } from '@coreui/icons-angular'; 7 | import { iconSubset } from '../../../icons/icon-subset'; 8 | 9 | describe('LoginComponent', () => { 10 | let component: LoginComponent; 11 | let fixture: ComponentFixture; 12 | let iconSetService: IconSetService; 13 | 14 | beforeEach(async () => { 15 | await TestBed.configureTestingModule({ 16 | imports: [FormModule, CardModule, GridModule, ButtonModule, IconModule, LoginComponent], 17 | providers: [IconSetService] 18 | }) 19 | .compileComponents(); 20 | }); 21 | 22 | beforeEach(() => { 23 | iconSetService = TestBed.inject(IconSetService); 24 | iconSetService.icons = { ...iconSubset }; 25 | 26 | fixture = TestBed.createComponent(LoginComponent); 27 | component = fixture.componentInstance; 28 | fixture.detectChanges(); 29 | }); 30 | 31 | it('should create', () => { 32 | expect(component).toBeTruthy(); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /frontend/src/app/views/pages/page404/page404.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |
6 |

404

7 |

Oops! You're lost.

8 |

9 | The page you are looking for was not found. 10 |

11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 |
23 | -------------------------------------------------------------------------------- /frontend/src/app/views/pages/page404/page404.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/app/views/pages/page404/page404.component.scss -------------------------------------------------------------------------------- /frontend/src/app/views/pages/page404/page404.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ButtonModule, FormModule, GridModule } from '@coreui/angular'; 4 | import { IconModule } from '@coreui/icons-angular'; 5 | import { IconSetService } from '@coreui/icons-angular'; 6 | import { iconSubset } from '../../../icons/icon-subset'; 7 | import { Page404Component } from './page404.component'; 8 | 9 | describe('Page404Component', () => { 10 | let component: Page404Component; 11 | let fixture: ComponentFixture; 12 | let iconSetService: IconSetService; 13 | 14 | beforeEach(async () => { 15 | await TestBed.configureTestingModule({ 16 | imports: [FormModule, GridModule, ButtonModule, IconModule, Page404Component], 17 | providers: [IconSetService] 18 | }) 19 | .compileComponents(); 20 | }); 21 | 22 | beforeEach(() => { 23 | iconSetService = TestBed.inject(IconSetService); 24 | iconSetService.icons = { ...iconSubset }; 25 | 26 | fixture = TestBed.createComponent(Page404Component); 27 | component = fixture.componentInstance; 28 | fixture.detectChanges(); 29 | }); 30 | 31 | it('should create', () => { 32 | expect(component).toBeTruthy(); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /frontend/src/app/views/pages/page404/page404.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IconDirective } from '@coreui/icons-angular'; 3 | import { ContainerComponent, RowComponent, ColComponent, InputGroupComponent, InputGroupTextDirective, FormControlDirective, ButtonDirective } from '@coreui/angular'; 4 | 5 | @Component({ 6 | selector: 'app-page404', 7 | templateUrl: './page404.component.html', 8 | styleUrls: ['./page404.component.scss'], 9 | standalone: true, 10 | imports: [ContainerComponent, RowComponent, ColComponent, InputGroupComponent, InputGroupTextDirective, IconDirective, FormControlDirective, ButtonDirective] 11 | }) 12 | export class Page404Component { 13 | 14 | constructor() { } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /frontend/src/app/views/pages/page500/page500.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |

500

7 |

Houston, we have a problem!

8 |

9 | The page you are looking for is temporarily unavailable. 10 |

11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 |
23 | -------------------------------------------------------------------------------- /frontend/src/app/views/pages/page500/page500.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/app/views/pages/page500/page500.component.scss -------------------------------------------------------------------------------- /frontend/src/app/views/pages/page500/page500.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ButtonModule, FormModule, GridModule } from '@coreui/angular'; 4 | import { IconModule } from '@coreui/icons-angular'; 5 | import { IconSetService } from '@coreui/icons-angular'; 6 | import { iconSubset } from '../../../icons/icon-subset'; 7 | import { Page500Component } from './page500.component'; 8 | 9 | describe('Page500Component', () => { 10 | let component: Page500Component; 11 | let fixture: ComponentFixture; 12 | let iconSetService: IconSetService; 13 | 14 | beforeEach(async () => { 15 | await TestBed.configureTestingModule({ 16 | imports: [GridModule, ButtonModule, FormModule, IconModule, Page500Component], 17 | providers: [IconSetService] 18 | }) 19 | .compileComponents(); 20 | }); 21 | 22 | beforeEach(() => { 23 | iconSetService = TestBed.inject(IconSetService); 24 | iconSetService.icons = { ...iconSubset }; 25 | 26 | fixture = TestBed.createComponent(Page500Component); 27 | component = fixture.componentInstance; 28 | fixture.detectChanges(); 29 | }); 30 | 31 | it('should create', () => { 32 | expect(component).toBeTruthy(); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /frontend/src/app/views/pages/page500/page500.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IconDirective } from '@coreui/icons-angular'; 3 | import { ContainerComponent, RowComponent, ColComponent, InputGroupComponent, InputGroupTextDirective, FormControlDirective, ButtonDirective } from '@coreui/angular'; 4 | 5 | @Component({ 6 | selector: 'app-page500', 7 | templateUrl: './page500.component.html', 8 | styleUrls: ['./page500.component.scss'], 9 | standalone: true, 10 | imports: [ContainerComponent, RowComponent, ColComponent, InputGroupComponent, InputGroupTextDirective, IconDirective, FormControlDirective, ButtonDirective] 11 | }) 12 | export class Page500Component { 13 | 14 | constructor() { } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /frontend/src/app/views/pages/register/register.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/app/views/pages/register/register.component.scss -------------------------------------------------------------------------------- /frontend/src/app/views/pages/register/register.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ButtonModule, CardModule, FormModule, GridModule } from '@coreui/angular'; 4 | import { IconModule } from '@coreui/icons-angular'; 5 | import { IconSetService } from '@coreui/icons-angular'; 6 | import { iconSubset } from '../../../icons/icon-subset'; 7 | import { RegisterComponent } from './register.component'; 8 | 9 | describe('RegisterComponent', () => { 10 | let component: RegisterComponent; 11 | let fixture: ComponentFixture; 12 | let iconSetService: IconSetService; 13 | 14 | beforeEach(async () => { 15 | await TestBed.configureTestingModule({ 16 | imports: [CardModule, FormModule, GridModule, ButtonModule, IconModule, RegisterComponent], 17 | providers: [IconSetService] 18 | }) 19 | .compileComponents(); 20 | }); 21 | 22 | beforeEach(() => { 23 | iconSetService = TestBed.inject(IconSetService); 24 | iconSetService.icons = { ...iconSubset }; 25 | 26 | fixture = TestBed.createComponent(RegisterComponent); 27 | component = fixture.componentInstance; 28 | fixture.detectChanges(); 29 | }); 30 | 31 | it('should create', () => { 32 | expect(component).toBeTruthy(); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /frontend/src/app/views/pages/register/register.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IconDirective } from '@coreui/icons-angular'; 3 | import { ContainerComponent, RowComponent, ColComponent, TextColorDirective, CardComponent, CardBodyComponent, FormDirective, InputGroupComponent, InputGroupTextDirective, FormControlDirective, ButtonDirective } from '@coreui/angular'; 4 | 5 | @Component({ 6 | selector: 'app-register', 7 | templateUrl: './register.component.html', 8 | styleUrls: ['./register.component.scss'], 9 | standalone: true, 10 | imports: [ContainerComponent, RowComponent, ColComponent, TextColorDirective, CardComponent, CardBodyComponent, FormDirective, InputGroupComponent, InputGroupTextDirective, IconDirective, FormControlDirective, ButtonDirective] 11 | }) 12 | export class RegisterComponent { 13 | 14 | constructor() { } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /frontend/src/app/views/pages/routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | export const routes: Routes = [ 4 | { 5 | path: '404', 6 | loadComponent: () => import('./page404/page404.component').then(m => m.Page404Component), 7 | data: { 8 | title: 'Page 404' 9 | } 10 | }, 11 | { 12 | path: '500', 13 | loadComponent: () => import('./page500/page500.component').then(m => m.Page500Component), 14 | data: { 15 | title: 'Page 500' 16 | } 17 | }, 18 | { 19 | path: 'login', 20 | loadComponent: () => import('./login/login.component').then(m => m.LoginComponent), 21 | data: { 22 | title: 'Login Page' 23 | } 24 | }, 25 | { 26 | path: 'change', 27 | loadComponent: () => import('./change-password/change-password.component').then(m => m.ChangePasswordComponent), 28 | data: { 29 | title: 'Set Password' 30 | } 31 | }, 32 | { 33 | path: 'register', 34 | loadComponent: () => import('./register/register.component').then(m => m.RegisterComponent), 35 | data: { 36 | title: 'Register Page' 37 | } 38 | } 39 | ]; 40 | -------------------------------------------------------------------------------- /frontend/src/app/views/security-dashboard/routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | import {SecurityDashboardComponent} from "./security-dashboard.component"; 3 | 4 | 5 | export const routes: Routes = [ 6 | { 7 | path: '', 8 | component: SecurityDashboardComponent, 9 | data: { 10 | title: 'Statistics' 11 | } 12 | } 13 | ]; 14 | -------------------------------------------------------------------------------- /frontend/src/app/views/security-dashboard/security-dashboard.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SecurityDashboardComponent } from './security-dashboard.component'; 4 | 5 | describe('SecurityDashboardComponent', () => { 6 | let component: SecurityDashboardComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [SecurityDashboardComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(SecurityDashboardComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-cloud-subscription/cloud-subscription-info/cloud-subscription-info.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CloudSubscriptionInfoComponent } from './cloud-subscription-info.component'; 4 | 5 | describe('CloudSubscriptionInfoComponent', () => { 6 | let component: CloudSubscriptionInfoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [CloudSubscriptionInfoComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(CloudSubscriptionInfoComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-cloud-subscription/cloud-vulnerabilities-table/cloud-vulnerabilities-table.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CloudVulnerabilitiesTableComponent } from './cloud-vulnerabilities-table.component'; 4 | 5 | describe('CloudVulnerabilitiesTableComponent', () => { 6 | let component: CloudVulnerabilitiesTableComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [CloudVulnerabilitiesTableComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(CloudVulnerabilitiesTableComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-cloud-subscription/cloud-vulnerability-details/cloud-vulnerability-details.component.scss: -------------------------------------------------------------------------------- 1 | .dot { 2 | width: 14px; 3 | height: 14px; 4 | border-radius: 50%; 5 | display: inline-block; 6 | } 7 | 8 | .critical { 9 | background-color: red; 10 | } 11 | 12 | .high { 13 | background-color: #f33d3d; 14 | } 15 | 16 | .medium { 17 | background-color: #e38334; 18 | } 19 | 20 | .low { 21 | background-color: #47a3d3; 22 | } 23 | 24 | .critical-t { 25 | color: red; 26 | } 27 | 28 | .high-t { 29 | color: #f33d3d; 30 | } 31 | 32 | .medium-t { 33 | color: #e38334; 34 | } 35 | 36 | .low-t { 37 | color: #47a3d3; 38 | } 39 | 40 | .comments-container { 41 | .comment-item { 42 | &:not(:last-child) { 43 | border-bottom: 1px solid rgba(0,0,0,.125); 44 | padding-bottom: 1rem; 45 | } 46 | 47 | .comment-avatar { 48 | .rounded-circle { 49 | background-color: #f8f9fa; 50 | color: #6c757d; 51 | font-weight: bold; 52 | } 53 | } 54 | 55 | .comment-content { 56 | background-color: #f8f9fa; 57 | border-radius: 0.5rem; 58 | padding: 0.5rem 1rem; 59 | } 60 | } 61 | } 62 | 63 | /* Styles for markdown rendering */ 64 | .markdown-body { 65 | box-sizing: border-box; 66 | min-width: 200px; 67 | max-width: 980px; 68 | margin: 0 auto; 69 | padding: 45px; 70 | } -------------------------------------------------------------------------------- /frontend/src/app/views/show-cloud-subscription/cloud-vulnerability-details/cloud-vulnerability-details.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CloudVulnerabilityDetailsComponent } from './cloud-vulnerability-details.component'; 4 | 5 | describe('CloudVulnerabilityDetailsComponent', () => { 6 | let component: CloudVulnerabilityDetailsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [CloudVulnerabilityDetailsComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(CloudVulnerabilityDetailsComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-cloud-subscription/cloud-vulnerability-summary/cloud-vulnerability-summary.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CloudVulnerabilitySummaryComponent } from './cloud-vulnerability-summary.component'; 4 | 5 | describe('CloudVulnerabilitySummaryComponent', () => { 6 | let component: CloudVulnerabilitySummaryComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [CloudVulnerabilitySummaryComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(CloudVulnerabilitySummaryComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-cloud-subscription/routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | import {ShowCloudSubscriptionComponent} from "./show-cloud-subscription.component"; 3 | 4 | 5 | export const routes: Routes = [ 6 | { 7 | path: '', 8 | component: ShowCloudSubscriptionComponent, 9 | data: { 10 | title: 'Show Cloud Subscription Data' 11 | } 12 | } 13 | ]; 14 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-cloud-subscription/show-cloud-subscription.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ShowCloudSubscriptionComponent } from './show-cloud-subscription.component'; 4 | 5 | describe('ShowRepoComponent', () => { 6 | let component: ShowCloudSubscriptionComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [ShowCloudSubscriptionComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ShowCloudSubscriptionComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-repo/repository-info/repository-info.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { RepositoryInfoComponent } from './repository-info.component'; 4 | 5 | describe('RepositoryInfoComponent', () => { 6 | let component: RepositoryInfoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [RepositoryInfoComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(RepositoryInfoComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-repo/routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | import {ShowRepoComponent} from "./show-repo.component"; 3 | 4 | 5 | export const routes: Routes = [ 6 | { 7 | path: '', 8 | component: ShowRepoComponent, 9 | data: { 10 | title: 'Show Repo Data' 11 | } 12 | } 13 | ]; 14 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-repo/show-repo.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ShowRepoComponent } from './show-repo.component'; 4 | 5 | describe('ShowRepoComponent', () => { 6 | let component: ShowRepoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [ShowRepoComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ShowRepoComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-repo/vulnerabilities-table/vulnerabilities-table.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { VulnerabilitiesTableComponent } from './vulnerabilities-table.component'; 4 | 5 | describe('VulnerabilitiesTableComponent', () => { 6 | let component: VulnerabilitiesTableComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [VulnerabilitiesTableComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(VulnerabilitiesTableComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-repo/vulnerability-details/vulnerability-details.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { VulnerabilityDetailsComponent } from './vulnerability-details.component'; 4 | 5 | describe('VulnerabilityDetailsComponent', () => { 6 | let component: VulnerabilityDetailsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [VulnerabilityDetailsComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(VulnerabilityDetailsComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-repo/vulnerability-summary/vulnerability-summary.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { VulnerabilitySummaryComponent } from './vulnerability-summary.component'; 4 | 5 | describe('VulnerabilitySummaryComponent', () => { 6 | let component: VulnerabilitySummaryComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [VulnerabilitySummaryComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(VulnerabilitySummaryComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-team/routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | import {ShowTeamComponent} from "./show-team.component"; 3 | 4 | 5 | export const routes: Routes = [ 6 | { 7 | path: '', 8 | component: ShowTeamComponent, 9 | data: { 10 | title: 'Show Team Data' 11 | } 12 | } 13 | ]; 14 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-team/show-team.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ShowTeamComponent } from './show-team.component'; 4 | 5 | describe('ShowRepoComponent', () => { 6 | let component: ShowTeamComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [ShowTeamComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ShowTeamComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-team/team-info/team-info.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TeamInfoComponent } from './team-info.component'; 4 | 5 | describe('TeamInfoComponent', () => { 6 | let component: TeamInfoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [TeamInfoComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(TeamInfoComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-team/team-scan-info/team-scan-info.component.scss: -------------------------------------------------------------------------------- 1 | .vertical-align-multiple { 2 | display: flex; 3 | flex-direction: column; 4 | justify-content: center; 5 | height: 100%; 6 | } -------------------------------------------------------------------------------- /frontend/src/app/views/show-team/team-scan-info/team-scan-info.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TeamScanInfoComponent } from './team-scan-info.component'; 4 | 5 | describe('TeamScanInfoComponent', () => { 6 | let component: TeamScanInfoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [TeamScanInfoComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(TeamScanInfoComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-team/team-scan-info/team-scan-info.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { 3 | BadgeComponent, 4 | CardBodyComponent, 5 | CardComponent, 6 | CardHeaderComponent, 7 | ColComponent, 8 | RowComponent, 9 | SpinnerComponent 10 | } from '@coreui/angular'; 11 | import { NgxDatatableModule } from '@swimlane/ngx-datatable'; 12 | import {DatePipe, JsonPipe, NgForOf, NgIf} from '@angular/common'; 13 | import { FormsModule } from '@angular/forms'; 14 | import {IconDirective} from "@coreui/icons-angular"; 15 | 16 | @Component({ 17 | selector: 'app-team-scan-info', 18 | standalone: true, 19 | imports: [ 20 | RowComponent, 21 | ColComponent, 22 | CardComponent, 23 | CardHeaderComponent, 24 | CardBodyComponent, 25 | SpinnerComponent, 26 | NgxDatatableModule, 27 | BadgeComponent, 28 | DatePipe, 29 | NgIf, 30 | FormsModule, 31 | IconDirective, 32 | JsonPipe, 33 | NgForOf 34 | ], 35 | templateUrl: './team-scan-info.component.html', 36 | styleUrls: ['./team-scan-info.component.scss'] 37 | }) 38 | export class TeamScanInfoComponent { 39 | @Input() scanInfoLoading: boolean = false; 40 | @Input() allScanInfos: any[] = []; 41 | @Input() scanInfoLimit: number = 15; 42 | } -------------------------------------------------------------------------------- /frontend/src/app/views/show-team/team-statistics-chart/team-statistics-chart.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TeamStatisticsChartComponent } from './team-statistics-chart.component'; 4 | 5 | describe('TeamStatisticsChartComponent', () => { 6 | let component: TeamStatisticsChartComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [TeamStatisticsChartComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(TeamStatisticsChartComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-team/team-vulnerabilities-table/team-vulnerabilities-table.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TeamVulnerabilitiesTableComponent } from './team-vulnerabilities-table.component'; 4 | 5 | describe('TeamVulnerabilitiesTableComponent', () => { 6 | let component: TeamVulnerabilitiesTableComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [TeamVulnerabilitiesTableComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(TeamVulnerabilitiesTableComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-team/team-vulnerability-details/team-vulnerability-details.component.scss: -------------------------------------------------------------------------------- 1 | .dot { 2 | width: 14px; 3 | height: 14px; 4 | border-radius: 50%; 5 | display: inline-block; 6 | } 7 | 8 | .critical { 9 | background-color: red; 10 | } 11 | 12 | .high { 13 | background-color: #f33d3d; 14 | } 15 | 16 | .medium { 17 | background-color: #e38334; 18 | } 19 | 20 | .low { 21 | background-color: #47a3d3; 22 | } 23 | 24 | .critical-t { 25 | color: red; 26 | } 27 | 28 | .high-t { 29 | color: #f33d3d; 30 | } 31 | 32 | .medium-t { 33 | color: #e38334; 34 | } 35 | 36 | .low-t { 37 | color: #47a3d3; 38 | } 39 | 40 | .comments-container { 41 | .comment-item { 42 | &:not(:last-child) { 43 | border-bottom: 1px solid rgba(0, 0, 0, .125); 44 | padding-bottom: 1rem; 45 | } 46 | 47 | .comment-avatar { 48 | .rounded-circle { 49 | background-color: #f8f9fa; 50 | color: #6c757d; 51 | font-weight: bold; 52 | } 53 | } 54 | 55 | .comment-content { 56 | background-color: #f8f9fa; 57 | border-radius: 0.5rem; 58 | padding: 0.5rem 1rem; 59 | } 60 | } 61 | } 62 | 63 | /* Styles for markdown rendering */ 64 | .markdown-body { 65 | box-sizing: border-box; 66 | min-width: 200px; 67 | max-width: 980px; 68 | margin: 0 auto; 69 | padding: 45px; 70 | } -------------------------------------------------------------------------------- /frontend/src/app/views/show-team/team-vulnerability-details/team-vulnerability-details.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TeamVulnerabilityDetailsComponent } from './team-vulnerability-details.component'; 4 | 5 | describe('TeamVulnerabilityDetailsComponent', () => { 6 | let component: TeamVulnerabilityDetailsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [TeamVulnerabilityDetailsComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(TeamVulnerabilityDetailsComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/show-team/team-vulnerability-summary/team-vulnerability-summary.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TeamVulnerabilitySummaryComponent } from './team-vulnerability-summary.component'; 4 | 5 | describe('TeamVulnerabilitySummaryComponent', () => { 6 | let component: TeamVulnerabilitySummaryComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [TeamVulnerabilitySummaryComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(TeamVulnerabilitySummaryComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/threat-intel/infos/infos.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { InfosComponent } from './infos.component'; 4 | 5 | describe('InfosComponent', () => { 6 | let component: InfosComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [InfosComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(InfosComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/threat-intel/reviews/reviews.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ReviewsComponent } from './reviews.component'; 4 | 5 | describe('ReviewsComponent', () => { 6 | let component: ReviewsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [ReviewsComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ReviewsComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/threat-intel/routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | import {ThreatIntelComponent} from "./threat-intel.component"; 3 | 4 | 5 | export const routes: Routes = [ 6 | { 7 | path: '', 8 | component: ThreatIntelComponent, 9 | data: { 10 | title: 'Threat Intelligence' 11 | } 12 | } 13 | ]; 14 | -------------------------------------------------------------------------------- /frontend/src/app/views/threat-intel/threat-intel.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/app/views/threat-intel/threat-intel.component.scss -------------------------------------------------------------------------------- /frontend/src/app/views/threat-intel/threat-intel.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ThreatIntelComponent } from './threat-intel.component'; 4 | 5 | describe('ThreatIntelComponent', () => { 6 | let component: ThreatIntelComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [ThreatIntelComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ThreatIntelComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/threat-intel/threat-list/threat-list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ThreatListComponent } from './threat-list.component'; 4 | 5 | describe('ThreatListComponent', () => { 6 | let component: ThreatListComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [ThreatListComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ThreatListComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/threat-intel/threat-score/threat-score.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ThreatScoreComponent } from './threat-score.component'; 4 | 5 | describe('ThreatScoreComponent', () => { 6 | let component: ThreatScoreComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [ThreatScoreComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(ThreatScoreComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/threat-intel/waivers/waivers.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { WaiversComponent } from './waivers.component'; 4 | 5 | describe('WaiversComponent', () => { 6 | let component: WaiversComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [WaiversComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(WaiversComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/vulnerabilities/routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | import {VulnerabilitiesComponent} from "./vulnerabilities.component"; 3 | 4 | 5 | export const routes: Routes = [ 6 | { 7 | path: '', 8 | component: VulnerabilitiesComponent, 9 | data: { 10 | title: 'Vulnerabilities' 11 | } 12 | } 13 | ]; 14 | -------------------------------------------------------------------------------- /frontend/src/app/views/vulnerabilities/vulnerabilities.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/app/views/vulnerabilities/vulnerabilities.component.scss -------------------------------------------------------------------------------- /frontend/src/app/views/vulnerabilities/vulnerabilities.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { VulnerabilitiesComponent } from './vulnerabilities.component'; 4 | 5 | describe('VulnerabilitiesComponent', () => { 6 | let component: VulnerabilitiesComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [VulnerabilitiesComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(VulnerabilitiesComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /frontend/src/app/views/widgets/routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | export const routes: Routes = [ 4 | { 5 | path: '', 6 | loadComponent: () => import('./widgets/widgets.component').then(m => m.WidgetsComponent), 7 | data: { 8 | title: 'Widgets' 9 | } 10 | } 11 | ]; 12 | -------------------------------------------------------------------------------- /frontend/src/app/views/widgets/widgets-brand/widgets-brand.component.html: -------------------------------------------------------------------------------- 1 | 2 | @for (widget of brandData; track widget; let i = $index) { 3 | 4 | 9 | 10 | @if (withCharts) { 11 | 18 | {{ chart.id }} 19 | 20 | } 21 | 22 | 23 | } 24 | 25 | -------------------------------------------------------------------------------- /frontend/src/app/views/widgets/widgets-brand/widgets-brand.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/app/views/widgets/widgets-brand/widgets-brand.component.scss -------------------------------------------------------------------------------- /frontend/src/app/views/widgets/widgets-brand/widgets-brand.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { GridModule, WidgetModule } from '@coreui/angular'; 4 | import { ChartjsModule } from '@coreui/angular-chartjs'; 5 | import { IconModule } from '@coreui/icons-angular'; 6 | import { IconSetService } from '@coreui/icons-angular'; 7 | import { iconSubset } from '../../../icons/icon-subset'; 8 | import { WidgetsBrandComponent } from './widgets-brand.component'; 9 | 10 | describe('WidgetsBrandComponent', () => { 11 | let component: WidgetsBrandComponent; 12 | let fixture: ComponentFixture; 13 | let iconSetService: IconSetService; 14 | 15 | beforeEach(async () => { 16 | await TestBed.configureTestingModule({ 17 | imports: [WidgetModule, GridModule, ChartjsModule, IconModule, WidgetsBrandComponent], 18 | providers: [IconSetService] 19 | }) 20 | .compileComponents(); 21 | }); 22 | 23 | beforeEach(() => { 24 | iconSetService = TestBed.inject(IconSetService); 25 | iconSetService.icons = { ...iconSubset }; 26 | 27 | fixture = TestBed.createComponent(WidgetsBrandComponent); 28 | component = fixture.componentInstance; 29 | fixture.detectChanges(); 30 | }); 31 | 32 | it('should create', () => { 33 | expect(component).toBeTruthy(); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /frontend/src/app/views/widgets/widgets-e/widgets-e.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/app/views/widgets/widgets-e/widgets-e.component.scss -------------------------------------------------------------------------------- /frontend/src/app/views/widgets/widgets-e/widgets-e.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { GridModule, WidgetModule } from '@coreui/angular'; 4 | import { ChartjsModule } from '@coreui/angular-chartjs'; 5 | import { IconSetService } from '@coreui/icons-angular'; 6 | import { iconSubset } from '../../../icons/icon-subset'; 7 | import { WidgetsEComponent } from './widgets-e.component'; 8 | 9 | describe('WidgetsEComponent', () => { 10 | let component: WidgetsEComponent; 11 | let fixture: ComponentFixture; 12 | let iconSetService: IconSetService; 13 | 14 | beforeEach(async () => { 15 | await TestBed.configureTestingModule({ 16 | imports: [WidgetModule, GridModule, ChartjsModule, WidgetsEComponent], 17 | providers: [IconSetService] 18 | }) 19 | .compileComponents(); 20 | }); 21 | 22 | beforeEach(() => { 23 | iconSetService = TestBed.inject(IconSetService); 24 | iconSetService.icons = { ...iconSubset }; 25 | 26 | fixture = TestBed.createComponent(WidgetsEComponent); 27 | component = fixture.componentInstance; 28 | fixture.detectChanges(); 29 | }); 30 | 31 | it('should create', () => { 32 | expect(component).toBeTruthy(); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /frontend/src/app/views/widgets/widgets/widgets.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/app/views/widgets/widgets/widgets.component.scss -------------------------------------------------------------------------------- /frontend/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/.gitkeep -------------------------------------------------------------------------------- /frontend/src/assets/angular.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/angular.ico -------------------------------------------------------------------------------- /frontend/src/assets/brand/coreui-signet-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | signet_white 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /frontend/src/assets/brand/coreui-signet.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | signet 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /frontend/src/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/favicon.ico -------------------------------------------------------------------------------- /frontend/src/assets/images/angular.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/angular.jpg -------------------------------------------------------------------------------- /frontend/src/assets/images/avatars/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/avatars/8.png -------------------------------------------------------------------------------- /frontend/src/assets/images/flow_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/flow_logo.jpg -------------------------------------------------------------------------------- /frontend/src/assets/images/flow_logo_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/flow_logo_text.png -------------------------------------------------------------------------------- /frontend/src/assets/images/flow_logo_text_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/flow_logo_text_transparent.png -------------------------------------------------------------------------------- /frontend/src/assets/images/flow_logo_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/flow_logo_transparent.png -------------------------------------------------------------------------------- /frontend/src/assets/images/logo_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/logo_32.png -------------------------------------------------------------------------------- /frontend/src/assets/images/logo_fill_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/logo_fill_text.png -------------------------------------------------------------------------------- /frontend/src/assets/images/logo_no_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/logo_no_text.png -------------------------------------------------------------------------------- /frontend/src/assets/images/logo_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/logo_text.png -------------------------------------------------------------------------------- /frontend/src/assets/images/logo_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/logo_vertical.png -------------------------------------------------------------------------------- /frontend/src/assets/images/logo_vertical_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/logo_vertical_32.png -------------------------------------------------------------------------------- /frontend/src/assets/images/logo_vertical_fill-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/logo_vertical_fill-32.png -------------------------------------------------------------------------------- /frontend/src/assets/images/logo_vertical_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/logo_vertical_fill.png -------------------------------------------------------------------------------- /frontend/src/assets/images/react.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/react.jpg -------------------------------------------------------------------------------- /frontend/src/assets/images/vue.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/assets/images/vue.jpg -------------------------------------------------------------------------------- /frontend/src/components/docs-callout/docs-callout.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | @if (!!name) { 7 |

8 | An Angular {{ name }} component{{ plural ? 's' : '' }} {{ plural ? 'have' : 'has' }} been created as a native 9 | Angular 10 | version 11 | of Bootstrap {{ name }}. {{ name }} {{ plural ? 'are' : 'is' }} delivered with some new features, 12 | variants, and unique design that matches CoreUI Design System requirements. 13 |

14 | } 15 | 16 | 17 | 18 |
19 | For more information please visit our official documentation of CoreUI Components Library for Angular. 20 |
21 | -------------------------------------------------------------------------------- /frontend/src/components/docs-callout/docs-callout.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/components/docs-callout/docs-callout.component.scss -------------------------------------------------------------------------------- /frontend/src/components/docs-callout/docs-callout.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DocsCalloutComponent } from './docs-callout.component'; 4 | import { CalloutModule } from '@coreui/angular'; 5 | 6 | describe('DocsCalloutComponent', () => { 7 | let component: DocsCalloutComponent; 8 | let fixture: ComponentFixture; 9 | 10 | beforeEach(async () => { 11 | await TestBed.configureTestingModule({ 12 | imports: [CalloutModule, DocsCalloutComponent] 13 | }) 14 | .compileComponents(); 15 | }); 16 | 17 | beforeEach(() => { 18 | fixture = TestBed.createComponent(DocsCalloutComponent); 19 | component = fixture.componentInstance; 20 | fixture.detectChanges(); 21 | }); 22 | 23 | it('should create', () => { 24 | expect(component).toBeTruthy(); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /frontend/src/components/docs-callout/docs-callout.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import packageJson from '../../../package.json'; 3 | import { NgTemplateOutlet } from '@angular/common'; 4 | import { CalloutComponent } from '@coreui/angular'; 5 | 6 | @Component({ 7 | selector: 'app-docs-callout', 8 | templateUrl: './docs-callout.component.html', 9 | styleUrls: ['./docs-callout.component.scss'], 10 | standalone: true, 11 | imports: [CalloutComponent, NgTemplateOutlet] 12 | }) 13 | export class DocsCalloutComponent { 14 | 15 | @Input() name: string = ''; 16 | 17 | constructor() { } 18 | 19 | private _href: string = 'https://coreui.io/angular/docs/'; 20 | 21 | get href(): string { 22 | return this._href; 23 | } 24 | 25 | @Input() 26 | set href(value: string) { 27 | const version = packageJson?.config?.coreui_library_short_version; 28 | const docsUrl = packageJson?.config?.coreui_library_docs_url ?? 'https://coreui.io/angular/'; 29 | // const path: string = version ? `${version}/${value}` : `${value}`; 30 | const path: string = value; 31 | this._href = `${docsUrl}${path}`; 32 | } 33 | 34 | get plural() { 35 | return this.name?.slice(-1) === 's'; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /frontend/src/components/docs-example/docs-example.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Preview 6 | 7 | 8 | 9 | 10 | 11 | Code 12 | 13 | 14 | 15 |
16 |
17 | 18 |
19 |
20 | -------------------------------------------------------------------------------- /frontend/src/components/docs-example/docs-example.component.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | display: block; 3 | } 4 | -------------------------------------------------------------------------------- /frontend/src/components/docs-example/docs-example.component.spec.ts: -------------------------------------------------------------------------------- 1 | // import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | // 3 | // import { DocsExampleComponent } from './docs-example.component'; 4 | // 5 | // describe('DocsExampleComponent', () => { 6 | // let component: DocsExampleComponent; 7 | // let fixture: ComponentFixture; 8 | // 9 | // beforeEach(async () => { 10 | // await TestBed.configureTestingModule({ 11 | // declarations: [ DocsExampleComponent ] 12 | // }) 13 | // .compileComponents(); 14 | // }); 15 | // 16 | // beforeEach(() => { 17 | // fixture = TestBed.createComponent(DocsExampleComponent); 18 | // component = fixture.componentInstance; 19 | // fixture.detectChanges(); 20 | // }); 21 | // 22 | // it('should create', () => { 23 | // expect(component).toBeTruthy(); 24 | // }); 25 | // }); 26 | -------------------------------------------------------------------------------- /frontend/src/components/docs-link/docs-link.component.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /frontend/src/components/docs-link/docs-link.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mixeway/Flow/ec2e82a2ccb1d929089fd44bedd1523fa3d0ac05/frontend/src/components/docs-link/docs-link.component.scss -------------------------------------------------------------------------------- /frontend/src/components/docs-link/docs-link.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DocsLinkComponent } from './docs-link.component'; 4 | 5 | describe('DocsLinkComponent', () => { 6 | let component: DocsLinkComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [DocsLinkComponent] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DocsLinkComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /frontend/src/components/docs-link/docs-link.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, HostBinding, Input, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-docs-link', 5 | templateUrl: './docs-link.component.html', 6 | styleUrls: ['./docs-link.component.scss'], 7 | standalone: true 8 | }) 9 | export class DocsLinkComponent implements OnInit { 10 | 11 | @Input() href?: string = 'https://coreui.io/angular/docs/'; 12 | @Input() name?: string; 13 | @Input() text?: string; 14 | 15 | constructor() { } 16 | 17 | @HostBinding('class') 18 | get hostClasses(): any { 19 | return { 20 | 'float-end': true 21 | }; 22 | } 23 | 24 | ngOnInit(): void { 25 | this.href = this.name ? `https://coreui.io/angular/docs/components/${this.name}` : this.href; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /frontend/src/components/index.ts: -------------------------------------------------------------------------------- 1 | export * from './public-api'; 2 | -------------------------------------------------------------------------------- /frontend/src/components/public-api.ts: -------------------------------------------------------------------------------- 1 | export { DocsCalloutComponent } from './docs-callout/docs-callout.component' 2 | export { DocsExampleComponent } from './docs-example/docs-example.component' 3 | export { DocsLinkComponent } from './docs-link/docs-link.component' 4 | -------------------------------------------------------------------------------- /frontend/src/declarations.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.json' { 2 | const value: any; 3 | export default value; 4 | } 5 | 6 | declare module '@coreui/icons'; 7 | -------------------------------------------------------------------------------- /frontend/src/environments/environment.dev.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: false, 3 | backendUrl: 'http://localhost:8888' // Backend URL for production 4 | }; -------------------------------------------------------------------------------- /frontend/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | backendUrl: '' // Backend URL for production 4 | }; -------------------------------------------------------------------------------- /frontend/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: false, 3 | backendUrl: '' // Backend URL for production 4 | }; -------------------------------------------------------------------------------- /frontend/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Mixeway Flow 9 | 10 | 11 | 12 | 13 |
14 | 15 | Loading... 16 |
17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /frontend/src/main.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { bootstrapApplication } from '@angular/platform-browser'; 4 | 5 | import { AppComponent } from './app/app.component'; 6 | import { appConfig } from './app/app.config'; 7 | 8 | bootstrapApplication(AppComponent, appConfig) 9 | .catch(err => console.error(err)); 10 | 11 | -------------------------------------------------------------------------------- /frontend/src/scss/_charts.scss: -------------------------------------------------------------------------------- 1 | // custom .chartjs-tooltip-body-item 2 | 3 | .chartjs-tooltip-body-item > td { 4 | padding-bottom: 0 !important; 5 | padding-top: 0 !important; 6 | font-size: smaller; 7 | } 8 | -------------------------------------------------------------------------------- /frontend/src/scss/_custom.scss: -------------------------------------------------------------------------------- 1 | // Here you can add other styles 2 | 3 | // custom .chartjs-tooltip-body-item padding 4 | @import "charts"; 5 | 6 | // custom tweaks for scrollbar styling (wip) 7 | @import "scrollbar"; 8 | 9 | // custom calendar today cell color 10 | .calendar-cell.today { 11 | --cui-calendar-cell-today-color: var(--cui-info) !important; 12 | } 13 | 14 | // custom select week cursor pointer 15 | .select-week .calendar-row.current { 16 | cursor: pointer; 17 | } 18 | -------------------------------------------------------------------------------- /frontend/src/scss/_fixes.scss: -------------------------------------------------------------------------------- 1 | // Place for temp fixes 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /frontend/src/scss/_scrollbar.scss: -------------------------------------------------------------------------------- 1 | // scrollbar tinkering 2 | 3 | @supports (scrollbar-width: thin) { 4 | * { 5 | scrollbar-width: thin; 6 | scrollbar-color: #444 transparent; 7 | } 8 | } 9 | 10 | //::-webkit-scrollbar { 11 | // width: .7em; 12 | // height: .7em; 13 | //} 14 | 15 | ::-webkit-scrollbar-track { 16 | background: var(--cui-body-bg, #fff); 17 | border-radius: 100vw; 18 | margin-block: .2em; 19 | } 20 | 21 | ::-webkit-scrollbar-thumb { 22 | background: #999; 23 | border: .15em solid var(--cui-body-bg, #fff); 24 | border-radius: 100vw; 25 | } 26 | 27 | ::-webkit-scrollbar-thumb:hover { 28 | background: #444; 29 | } 30 | 31 | .dark-theme::-webkit-scrollbar-thumb { 32 | background: var(--cui-gray-600, #444); 33 | } 34 | 35 | .dark-theme::-webkit-scrollbar-thumb:hover { 36 | background: var(--cui-gray-400, #999); 37 | } 38 | 39 | .ng-scroll-content { 40 | display: flex !important; 41 | } 42 | 43 | .ng-scrollbar:not(.overflow) .ng-scrollbar-wrapper[verticalused="false"] { 44 | //background-color: #e797a5; 45 | .ng-scroll-viewport { 46 | display: flex; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /frontend/src/scss/_variables.scss: -------------------------------------------------------------------------------- 1 | // Variable overrides 2 | // 3 | // If you want to customize your project please add your variables below. 4 | 5 | $enable-deprecation-messages: false !default; 6 | -------------------------------------------------------------------------------- /frontend/src/scss/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | 3 | // If you want to override variables do it here 4 | @import "variables"; 5 | 6 | 7 | // Import styles with default layout. 8 | @import "@coreui/coreui/scss/coreui"; 9 | 10 | 11 | // Import Chart.js custom tooltips styles 12 | @import "@coreui/chartjs/scss/coreui-chartjs"; 13 | 14 | 15 | // Custom styles for this theme 16 | @import "theme"; 17 | 18 | // Some temp fixes 19 | //@import "fixes"; 20 | 21 | // If you want to add custom CSS you can put it here. 22 | @import "custom"; 23 | 24 | // Examples 25 | // We use those styles to show code examples, you should remove them in your application. 26 | @import "examples"; 27 | -------------------------------------------------------------------------------- /frontend/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { teardown: { destroyAfterEach: true }}, 15 | ); 16 | -------------------------------------------------------------------------------- /frontend/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [ 7 | "@angular/localize" 8 | ], 9 | "paths": { 10 | "@docs-components/*": [ 11 | "./src/components/*" 12 | ] 13 | } 14 | }, 15 | "files": [ 16 | "src/main.ts" 17 | ], 18 | "include": [ 19 | "src/**/*.d.ts" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /frontend/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "esModuleInterop": true, 9 | "strict": true, 10 | "noImplicitOverride": true, 11 | "noPropertyAccessFromIndexSignature": true, 12 | "noImplicitReturns": true, 13 | "noFallthroughCasesInSwitch": true, 14 | "sourceMap": true, 15 | "declaration": false, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "allowSyntheticDefaultImports": true, 22 | "useDefineForClassFields": false, 23 | "lib": [ 24 | "ES2022", 25 | "dom" 26 | ] 27 | }, 28 | "angularCompilerOptions": { 29 | "enableI18nLegacyMessageIdFormat": false, 30 | "strictInjectionParameters": true, 31 | "strictInputAccessModifiers": true, 32 | "strictTemplates": true 33 | }, 34 | "files": [], 35 | "references": [ 36 | { "path": "./tsconfig.app.json" }, 37 | { "path": "./tsconfig.spec.json" }, 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /frontend/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine", 8 | "@angular/localize" 9 | ], 10 | "paths": { 11 | "@docs-components/*": ["./src/components/*"] 12 | } 13 | }, 14 | "files": [ 15 | "src/test.ts", 16 | ], 17 | "include": [ 18 | "src/**/*.spec.ts", 19 | "src/**/*.d.ts" 20 | ] 21 | } 22 | --------------------------------------------------------------------------------