├── .editorconfig ├── .env ├── .github ├── dependabot.yml └── workflows │ ├── security.yaml │ └── tests.yaml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── UPGRADE.md ├── bin └── console ├── composer.json ├── composer.lock ├── config ├── bootstrap.php ├── bundles.php ├── packages │ ├── cache.yaml │ ├── dev │ │ ├── maker.yaml │ │ ├── monolog.yaml │ │ └── web_profiler.yaml │ ├── doctrine.yaml │ ├── doctrine_migrations.yaml │ ├── ewz_recaptcha.yaml │ ├── flysystem.yaml │ ├── framework.yaml │ ├── knpu_oauth2_client.yaml │ ├── mailer.yaml │ ├── messenger.yaml │ ├── nelmio_api_doc.yaml │ ├── nelmio_cors.yaml │ ├── nyholm_psr7.yaml │ ├── prod │ │ ├── doctrine.yaml │ │ ├── monolog.yaml │ │ ├── routing.yaml │ │ └── sentry.yaml │ ├── routing.yaml │ ├── security.yaml │ ├── sensio_framework_extra.yaml │ ├── test │ │ ├── dama_doctrine_test_bundle.yaml │ │ ├── ewz_recaptcha.yaml │ │ ├── flysystem.yaml │ │ ├── framework.yaml │ │ ├── knpu_oauth2_client.yaml │ │ ├── mailer.yaml │ │ ├── messenger.yaml │ │ ├── monolog.yaml │ │ ├── security.yaml │ │ ├── twig.yaml │ │ ├── validator.yaml │ │ └── web_profiler.yaml │ ├── twig.yaml │ └── validator.yaml ├── preload.php ├── routes │ ├── annotations.yaml │ ├── dev │ │ ├── framework.yaml │ │ └── web_profiler.yaml │ └── nelmio_api_doc.yaml ├── services.yaml ├── services_dev.yaml └── services_test.yaml ├── phpstan-baseline.neon ├── public ├── .htaccess ├── dist │ ├── css │ │ ├── dashboard.css │ │ └── tabler.min.css │ └── js │ │ └── apexcharts.min.js ├── favicon.ico ├── index.php ├── repman-horizontal.png ├── repman-horizontal.svg ├── repman-vertical.svg └── robots.txt ├── src ├── Command │ ├── ClearMetadataCacheCommand.php │ ├── ClearOldPrivateDistsCommand.php │ ├── CreateAdminCommand.php │ ├── CreateUserCommand.php │ ├── ProxySyncMetadataCommand.php │ ├── ProxySyncReleasesCommand.php │ ├── ScanAllPackagesCommand.php │ ├── SendTelemetryCommand.php │ ├── SynchronizeAllPackagesCommand.php │ ├── SynchronizePackageCommand.php │ └── UpdateAdvisoriesDbCommand.php ├── Controller │ ├── Admin │ │ ├── ConfigController.php │ │ ├── OrganizationController.php │ │ ├── ProxyController.php │ │ └── UserController.php │ ├── Api │ │ ├── ApiController.php │ │ ├── OrganizationController.php │ │ ├── PackageController.php │ │ └── TokenController.php │ ├── IndexController.php │ ├── OAuth │ │ ├── BitbucketController.php │ │ ├── BuddyController.php │ │ ├── GitHubController.php │ │ ├── GitLabController.php │ │ └── OAuthController.php │ ├── Organization │ │ ├── MembersController.php │ │ └── PackageController.php │ ├── OrganizationController.php │ ├── ProxyController.php │ ├── RegistrationController.php │ ├── RepoController.php │ ├── SecurityController.php │ ├── UserController.php │ └── WebhookController.php ├── DataFixtures │ ├── PrivatePackageDownloadFixtures.php │ ├── ProxyPackageDownloadFixtures.php │ ├── TokenFixtures.php │ └── UserFixtures.php ├── Entity │ ├── Config.php │ ├── Organization.php │ ├── Organization │ │ ├── Invitation.php │ │ ├── Member.php │ │ ├── Package.php │ │ ├── Package │ │ │ ├── Download.php │ │ │ ├── Link.php │ │ │ ├── Metadata.php │ │ │ ├── ScanResult.php │ │ │ └── Version.php │ │ └── Token.php │ ├── User.php │ └── User │ │ ├── ApiToken.php │ │ └── OAuthToken.php ├── Form │ └── Type │ │ ├── Admin │ │ └── ConfigType.php │ │ ├── Api │ │ ├── AddPackageType.php │ │ ├── CreateOrganizationType.php │ │ ├── EditPackageType.php │ │ └── GenerateTokenType.php │ │ ├── Organization │ │ ├── AddPackageType.php │ │ ├── ChangeAliasType.php │ │ ├── ChangeAnonymousAccessType.php │ │ ├── ChangeNameType.php │ │ ├── CreateType.php │ │ ├── EditPackageType.php │ │ ├── GenerateApiTokenType.php │ │ ├── GenerateTokenType.php │ │ ├── InviteMemberType.php │ │ └── Member │ │ │ └── ChangeRoleType.php │ │ └── User │ │ ├── ChangeEmailPreferencesType.php │ │ ├── ChangePasswordType.php │ │ ├── ChangeRolesType.php │ │ ├── ChangeTimezoneType.php │ │ ├── RegisterType.php │ │ ├── ResetPasswordType.php │ │ └── SendResetPasswordLinkType.php ├── Kernel.php ├── Message │ ├── Admin │ │ ├── AddTechnicalEmail.php │ │ ├── ChangeConfig.php │ │ └── RemoveTechnicalEmail.php │ ├── Organization │ │ ├── AddDownload.php │ │ ├── AddPackage.php │ │ ├── ChangeAlias.php │ │ ├── ChangeAnonymousAccess.php │ │ ├── ChangeName.php │ │ ├── CreateOrganization.php │ │ ├── GenerateToken.php │ │ ├── Member │ │ │ ├── AcceptInvitation.php │ │ │ ├── ChangeRole.php │ │ │ ├── InviteUser.php │ │ │ ├── RemoveInvitation.php │ │ │ └── RemoveMember.php │ │ ├── Package │ │ │ ├── AddBitbucketHook.php │ │ │ ├── AddGitHubHook.php │ │ │ ├── AddGitLabHook.php │ │ │ ├── RemoveBitbucketHook.php │ │ │ ├── RemoveGitHubHook.php │ │ │ ├── RemoveGitLabHook.php │ │ │ └── Update.php │ │ ├── RegenerateToken.php │ │ ├── RemoveOrganization.php │ │ ├── RemovePackage.php │ │ ├── RemoveToken.php │ │ └── SynchronizePackage.php │ ├── Proxy │ │ ├── AddDownloads.php │ │ ├── AddDownloads │ │ │ └── Package.php │ │ └── RemoveDist.php │ ├── Security │ │ ├── ScanPackage.php │ │ └── SendScanResult.php │ └── User │ │ ├── AddOAuthToken.php │ │ ├── ChangeEmailPreferences.php │ │ ├── ChangePassword.php │ │ ├── ChangeRoles.php │ │ ├── ChangeTimezone.php │ │ ├── ConfirmEmail.php │ │ ├── CreateOAuthUser.php │ │ ├── CreateUser.php │ │ ├── DisableUser.php │ │ ├── EnableUser.php │ │ ├── GenerateApiToken.php │ │ ├── RegenerateApiToken.php │ │ ├── RemoveApiToken.php │ │ ├── RemoveOAuthToken.php │ │ ├── RemoveUser.php │ │ ├── ResetPassword.php │ │ ├── SendConfirmToken.php │ │ └── SendPasswordResetLink.php ├── MessageHandler │ ├── Admin │ │ ├── AddTechnicalEmailHandler.php │ │ ├── ChangeConfigHandler.php │ │ └── RemoveTechnicalEmailHandler.php │ ├── Organization │ │ ├── AddDownloadHandler.php │ │ ├── AddPackageHandler.php │ │ ├── ChangeAliasHandler.php │ │ ├── ChangeAnonymousAccessHandler.php │ │ ├── ChangeNameHandler.php │ │ ├── CreateOrganizationHandler.php │ │ ├── GenerateTokenHandler.php │ │ ├── Member │ │ │ ├── AcceptInvitationHandler.php │ │ │ ├── ChangeRoleHandler.php │ │ │ ├── InviteUserHandler.php │ │ │ ├── RemoveInvitationHandler.php │ │ │ └── RemoveMemberHandler.php │ │ ├── Package │ │ │ ├── AbstractHookHandler.php │ │ │ ├── AddBitbucketHookHandler.php │ │ │ ├── AddGitHubHookHandler.php │ │ │ ├── AddGitLabHookHandler.php │ │ │ ├── RemoveBitbucketHookHandler.php │ │ │ ├── RemoveGitHubHookHandler.php │ │ │ ├── RemoveGitLabHookHandler.php │ │ │ └── UpdateHandler.php │ │ ├── RegenerateTokenHandler.php │ │ ├── RemoveOrganizationHandler.php │ │ ├── RemovePackageHandler.php │ │ ├── RemoveTokenHandler.php │ │ └── SynchronizePackageHandler.php │ ├── Proxy │ │ ├── AddDownloadsHandler.php │ │ └── RemoveDistHandler.php │ ├── Security │ │ ├── ScanPackageHandler.php │ │ └── SendScanResultHandler.php │ └── User │ │ ├── AddOAuthTokenHandler.php │ │ ├── ChangeEmailPreferencesHandler.php │ │ ├── ChangePasswordHandler.php │ │ ├── ChangeRolesHandler.php │ │ ├── ChangeTimezoneHandler.php │ │ ├── ConfirmEmailHandler.php │ │ ├── CreateOAuthUserHandler.php │ │ ├── CreateUserHandler.php │ │ ├── DisableUserHandler.php │ │ ├── EnableUserHandler.php │ │ ├── GenerateApiTokenHandler.php │ │ ├── RegenerateApiTokenHandler.php │ │ ├── RemoveApiTokenHandler.php │ │ ├── RemoveOAuthTokenHandler.php │ │ ├── RemoveUserHandler.php │ │ ├── ResetPasswordHandler.php │ │ ├── SendConfirmTokenHandler.php │ │ └── SendPasswordResetLinkHandler.php ├── Migrations │ ├── Factory │ │ └── MigrationFactoryDecorator.php │ ├── Version20200312091436.php │ ├── Version20200407141025.php │ ├── Version20200416051700.php │ ├── Version20200416172613.php │ ├── Version20200421143358.php │ ├── Version20200422190543.php │ ├── Version20200429045703.php │ ├── Version20200507052339.php │ ├── Version20200508153504.php │ ├── Version20200525193652.php │ ├── Version20200604151104.php │ ├── Version20200614133313.php │ ├── Version20200615181216.php │ ├── Version20200706181929.php │ ├── Version20200713195731.php │ ├── Version20200720112146.php │ ├── Version20200723105216.php │ ├── Version20200724131616.php │ ├── Version20200811170234.php │ ├── Version20200902191522.php │ ├── Version20200930164734.php │ ├── Version20201007124214.php │ ├── Version20201014155748.php │ ├── Version20210128083706.php │ ├── Version20210129111835.php │ ├── Version20210309201702.php │ ├── Version20210531095502.php │ ├── Version20220220163835.php │ └── Version20220316201455.php ├── Query │ ├── Admin │ │ ├── ConfigQuery.php │ │ ├── ConfigQuery │ │ │ └── DbalConfigQuery.php │ │ ├── Model │ │ │ ├── Organization.php │ │ │ └── User.php │ │ ├── OrganizationQuery.php │ │ ├── OrganizationQuery │ │ │ └── DbalOrganizationQuery.php │ │ ├── Proxy │ │ │ ├── DownloadsQuery.php │ │ │ ├── DownloadsQuery │ │ │ │ └── DbalDownloadsQuery.php │ │ │ └── Model │ │ │ │ └── Package.php │ │ ├── TelemetryQuery.php │ │ ├── TelemetryQuery │ │ │ └── DbalTelemetryQuery.php │ │ ├── UserQuery.php │ │ └── UserQuery │ │ │ └── DbalUserQuery.php │ ├── Api │ │ ├── Model │ │ │ ├── Error.php │ │ │ ├── Errors.php │ │ │ ├── Links.php │ │ │ ├── Organization.php │ │ │ ├── Organizations.php │ │ │ ├── Package.php │ │ │ ├── Packages.php │ │ │ ├── Paginated.php │ │ │ ├── Token.php │ │ │ └── Tokens.php │ │ ├── OrganizationQuery.php │ │ ├── OrganizationQuery │ │ │ └── DbalOrganizationQuery.php │ │ ├── PackageQuery.php │ │ └── PackageQuery │ │ │ └── DbalPackageQuery.php │ ├── Filter.php │ └── User │ │ ├── Model │ │ ├── ApiToken.php │ │ ├── Installs.php │ │ ├── Installs │ │ │ └── Day.php │ │ ├── OAuthToken.php │ │ ├── Organization.php │ │ ├── Organization │ │ │ ├── Invitation.php │ │ │ ├── Member.php │ │ │ └── Token.php │ │ ├── Package.php │ │ ├── Package │ │ │ └── Link.php │ │ ├── PackageDetails.php │ │ ├── PackageName.php │ │ ├── PackageScanResultTrait.php │ │ ├── ScanResult.php │ │ ├── Version.php │ │ └── WebhookRequest.php │ │ ├── OrganizationQuery.php │ │ ├── OrganizationQuery │ │ └── DbalOrganizationQuery.php │ │ ├── PackageQuery.php │ │ ├── PackageQuery │ │ ├── DbalPackageQuery.php │ │ └── Filter.php │ │ ├── UserQuery.php │ │ └── UserQuery │ │ └── DbalUserQuery.php ├── Repository │ ├── ConfigRepository.php │ ├── OrganizationRepository.php │ ├── PackageRepository.php │ ├── ScanResultRepository.php │ └── UserRepository.php ├── Security │ ├── AnonymousOrganizationUserAuthenticator.php │ ├── ApiTokenAuthenticator.php │ ├── ApiUserProvider.php │ ├── BitbucketAuthenticator.php │ ├── BuddyAuthenticator.php │ ├── GitHubAuthenticator.php │ ├── GitLabAuthenticator.php │ ├── LoginFormAuthenticator.php │ ├── Model │ │ ├── Organization.php │ │ ├── User.php │ │ └── User │ │ │ └── Organization.php │ ├── OAuthAuthenticator.php │ ├── OrganizationProvider.php │ ├── TokenAuthenticator.php │ ├── UserChecker.php │ ├── UserGuardHelper.php │ └── UserProvider.php ├── Service │ ├── Api │ │ ├── PackageParamConverter.php │ │ └── TokenParamConverter.php │ ├── Config.php │ ├── Dist.php │ ├── Dist │ │ ├── FilePatternFilterIterator.php │ │ └── Storage.php │ ├── Doctrine │ │ └── FixPostgreSQLDefaultSchemaListener.php │ ├── Downloader.php │ ├── Downloader │ │ └── ReactDownloader.php │ ├── Integration │ │ ├── Aws │ │ │ └── S3AdapterFactory.php │ │ ├── BitbucketApi.php │ │ ├── BitbucketApi │ │ │ ├── Repositories.php │ │ │ ├── Repository.php │ │ │ └── RestBitbucketApi.php │ │ ├── BuddyApi.php │ │ ├── BuddyApi │ │ │ ├── BuddyApiException.php │ │ │ └── RestBuddyApi.php │ │ ├── GitHubApi.php │ │ ├── GitHubApi │ │ │ └── RestGitHubApi.php │ │ ├── GitLabApi.php │ │ └── GitLabApi │ │ │ ├── Project.php │ │ │ ├── Projects.php │ │ │ └── RestGitLabApi.php │ ├── IntegrationRegister.php │ ├── Json.php │ ├── Mailer.php │ ├── Mailer │ │ └── SymfonyMailer.php │ ├── Organization │ │ ├── AliasGenerator.php │ │ ├── MemberParamConverter.php │ │ ├── OrganizationAnonymousUserVoter.php │ │ ├── OrganizationParamConverter.php │ │ ├── OrganizationVoter.php │ │ ├── PackageDetailsParamConverter.php │ │ ├── PackageManager.php │ │ ├── PackageParamConverter.php │ │ ├── TokenGenerator.php │ │ ├── TokenGenerator │ │ │ └── RandomTokenGenerator.php │ │ ├── TokenParamConverter.php │ │ └── WebhookRequests.php │ ├── PackageNormalizer.php │ ├── PackageSynchronizer.php │ ├── PackageSynchronizer │ │ └── ComposerPackageSynchronizer.php │ ├── Proxy.php │ ├── Proxy │ │ ├── DistFile.php │ │ ├── Downloads.php │ │ ├── Downloads │ │ │ └── Package.php │ │ ├── Metadata.php │ │ ├── ProxyFactory.php │ │ └── ProxyRegister.php │ ├── ReadmeExtractor.php │ ├── Security │ │ ├── PackageScanner.php │ │ ├── PackageScanner │ │ │ └── SensioLabsPackageScanner.php │ │ ├── SecurityChecker.php │ │ └── SecurityChecker │ │ │ ├── Advisory.php │ │ │ ├── Package.php │ │ │ ├── Result.php │ │ │ ├── SensioLabsSecurityChecker.php │ │ │ └── Versions.php │ ├── Stream.php │ ├── Symfony │ │ ├── ApiExceptionListener.php │ │ ├── ConsumedMessageLoggerMiddleware.php │ │ ├── ResponseCallback.php │ │ └── SentryRequestListener.php │ ├── Telemetry.php │ ├── Telemetry │ │ ├── Endpoint.php │ │ ├── Entry.php │ │ ├── Entry │ │ │ ├── Downloads.php │ │ │ ├── Instance.php │ │ │ ├── Organization.php │ │ │ ├── Package.php │ │ │ └── Proxy.php │ │ ├── TechnicalEmail.php │ │ └── TelemetryEndpoint.php │ ├── Twig │ │ ├── BytesExtension.php │ │ ├── DateExtension.php │ │ └── OAuthProviderExtension.php │ └── User │ │ ├── ResetPasswordTokenGenerator.php │ │ ├── UserOAuthTokenProvider.php │ │ ├── UserOAuthTokenRefresher.php │ │ ├── UserOAuthTokenRefresher │ │ └── AccessToken.php │ │ └── UserParamConverter.php └── Validator │ ├── AliasNotBlank.php │ ├── AliasNotBlankValidator.php │ ├── NotOrganizationMember.php │ ├── NotOrganizationMemberValidator.php │ ├── UniqueEmail.php │ ├── UniqueEmailValidator.php │ ├── UniqueOrganization.php │ └── UniqueOrganizationValidator.php ├── symfony.lock ├── templates ├── admin │ ├── config │ │ └── edit.html.twig │ ├── organization │ │ └── list.html.twig │ ├── proxy │ │ ├── dist.html.twig │ │ └── stats.html.twig │ ├── stats.html.twig │ └── user │ │ ├── changeRoles.html.twig │ │ └── list.html.twig ├── base-card.html.twig ├── base.html.twig ├── bundles │ └── TwigBundle │ │ └── Exception │ │ ├── error.html.twig │ │ ├── error401.html.twig │ │ ├── error403.html.twig │ │ ├── error404.html.twig │ │ ├── error500.html.twig │ │ └── error503.html.twig ├── component │ ├── confirmationModal.html.twig │ ├── docsLink.html.twig │ ├── flash.html.twig │ ├── js │ │ ├── addPackage.js │ │ ├── base.js │ │ ├── ga.js │ │ ├── ga4.js │ │ ├── stats.js.twig │ │ └── statsVersions.js.twig │ ├── packageActions.html.twig │ ├── pagination.html.twig │ ├── signUpLink.html.twig │ ├── sort.html.twig │ ├── telemetryPrompt.html.twig │ └── user.html.twig ├── emails │ ├── base.twig │ ├── email-verification.html.twig │ ├── organization-invitation.html.twig │ ├── password-reset.html.twig │ └── scan-result.html.twig ├── form │ └── bootstrap_4_layout.html.twig ├── index.html.twig ├── organization │ ├── addPackage.html.twig │ ├── addPackageFromVcs.html.twig │ ├── create.html.twig │ ├── generateToken.html.twig │ ├── member │ │ ├── changeRole.twig │ │ ├── invitations.html.twig │ │ ├── invite.twig │ │ └── members.html.twig │ ├── overview.html.twig │ ├── package │ │ ├── details.html.twig │ │ ├── edit.html.twig │ │ ├── scanResultContent.html.twig │ │ ├── scanResults.html.twig │ │ ├── stats.html.twig │ │ └── webhook.html.twig │ ├── packages.html.twig │ ├── settings.html.twig │ ├── stats.html.twig │ └── tokens.html.twig ├── registration │ └── register.html.twig ├── security │ ├── login.html.twig │ ├── resetPassword.html.twig │ └── sendResetPasswordLink.html.twig ├── svg │ ├── arrow-left.svg │ ├── bar-chart.svg │ ├── bitbucket-icon.svg │ ├── briefcase.svg │ ├── check.svg │ ├── clipboard.svg │ ├── edit.svg │ ├── github-icon.svg │ ├── gitlab-icon.svg │ ├── home.svg │ ├── link.svg │ ├── lock.svg │ ├── log-out.svg │ ├── package.svg │ ├── plus-square.svg │ ├── refresh.svg │ ├── shield.svg │ ├── sliders.svg │ ├── sort-asc.svg │ ├── sort-desc.svg │ ├── trash.svg │ ├── unlock.svg │ ├── user.svg │ └── users.svg └── user │ ├── apiTokens.html.twig │ ├── generateApiToken.html.twig │ └── profile.html.twig └── var └── .gitkeep /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 4 6 | 7 | charset = utf-8 8 | max_line_length = 160 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [*.{yml,yaml}] 14 | indent_size = 2 15 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "composer" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | open-pull-requests-limit: 1 13 | -------------------------------------------------------------------------------- /.github/workflows/security.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | schedule: 3 | - cron: '0 12 * * *' 4 | workflow_dispatch: 5 | 6 | jobs: 7 | job: 8 | name: "Security" 9 | runs-on: "ubuntu-latest" 10 | 11 | steps: 12 | - name: "Checkout" 13 | uses: "actions/checkout@v4" 14 | with: 15 | show-progress: false 16 | 17 | - name: "Setup PHP" 18 | uses: "shivammathur/setup-php@v2" 19 | with: 20 | php-version: '7.4.2' 21 | 22 | - name: "Run composer audit" 23 | run: "composer audit --no-dev --locked" 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 BDY Sp. z o.o. Sp. k. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /config/bootstrap.php: -------------------------------------------------------------------------------- 1 | =1.2) 9 | if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV']) { 10 | foreach ($env as $k => $v) { 11 | $_ENV[$k] = $_ENV[$k] ?? (isset($_SERVER[$k]) && 0 !== strpos($k, 'HTTP_') ? $_SERVER[$k] : $v); 12 | } 13 | } elseif (!class_exists(Dotenv::class)) { 14 | throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); 15 | } else { 16 | // load all the .env files 17 | (new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env'); 18 | } 19 | 20 | $_SERVER += $_ENV; 21 | $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev'; 22 | $_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV']; 23 | $_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; 24 | -------------------------------------------------------------------------------- /config/packages/cache.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | cache: 3 | # Unique name of your app: used to compute stable namespaces for cache keys. 4 | #prefix_seed: your_vendor_name/app_name 5 | 6 | # The "app" cache stores to the filesystem by default. 7 | # The data in this cache should persist between deploys. 8 | # Other options include: 9 | 10 | # Redis 11 | #app: cache.adapter.redis 12 | #default_redis_provider: redis://localhost 13 | 14 | # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues) 15 | #app: cache.adapter.apcu 16 | 17 | # Namespaced pools use the above "app" backend by default 18 | pools: 19 | packagist_releases_feed.cache: 20 | adapter: cache.app 21 | 22 | config.cache: 23 | adapter: cache.app 24 | -------------------------------------------------------------------------------- /config/packages/dev/maker.yaml: -------------------------------------------------------------------------------- 1 | maker: 2 | root_namespace: 'Buddy\Repman' 3 | -------------------------------------------------------------------------------- /config/packages/dev/monolog.yaml: -------------------------------------------------------------------------------- 1 | monolog: 2 | handlers: 3 | main: 4 | type: stream 5 | path: "%kernel.logs_dir%/%kernel.environment%.log" 6 | level: debug 7 | channels: ["!event", "!request"] 8 | # uncomment to get logging in your browser 9 | # you may have to allow bigger header sizes in your Web server configuration 10 | #firephp: 11 | # type: firephp 12 | # level: info 13 | #chromephp: 14 | # type: chromephp 15 | # level: info 16 | console: 17 | type: console 18 | process_psr_3_messages: false 19 | channels: ["!event", "!doctrine", "!console"] 20 | -------------------------------------------------------------------------------- /config/packages/dev/web_profiler.yaml: -------------------------------------------------------------------------------- 1 | web_profiler: 2 | toolbar: true 3 | intercept_redirects: false 4 | 5 | framework: 6 | profiler: { only_exceptions: false } 7 | -------------------------------------------------------------------------------- /config/packages/doctrine.yaml: -------------------------------------------------------------------------------- 1 | doctrine: 2 | dbal: 3 | url: '%env(resolve:DATABASE_URL)%' 4 | types: 5 | uuid: 'Ramsey\Uuid\Doctrine\UuidType' 6 | schema_filter: '~^(?!messenger_messages|organization_package_webhook_request|proxy_package_download|lock_keys)~' 7 | orm: 8 | auto_generate_proxy_classes: true 9 | naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware 10 | auto_mapping: true 11 | mappings: 12 | Repman: 13 | is_bundle: false 14 | type: annotation 15 | dir: '%kernel.project_dir%/src/Entity' 16 | prefix: 'Buddy\Repman\Entity' 17 | alias: Repman 18 | -------------------------------------------------------------------------------- /config/packages/doctrine_migrations.yaml: -------------------------------------------------------------------------------- 1 | doctrine_migrations: 2 | migrations_paths: 3 | Buddy\Repman\Migrations: '%kernel.project_dir%/src/Migrations' 4 | services: 5 | Doctrine\Migrations\Version\MigrationFactory: Buddy\Repman\Migrations\Factory\MigrationFactoryDecorator 6 | storage: 7 | table_storage: 8 | table_name: 'migration_versions' 9 | -------------------------------------------------------------------------------- /config/packages/ewz_recaptcha.yaml: -------------------------------------------------------------------------------- 1 | ewz_recaptcha: 2 | enabled: '%env(bool:EWZ_RECAPTCHA_ENABLED)%' 3 | public_key: '%env(EWZ_RECAPTCHA_SITE_KEY)%' 4 | private_key: '%env(EWZ_RECAPTCHA_SECRET)%' 5 | -------------------------------------------------------------------------------- /config/packages/framework.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | secret: '%env(APP_SECRET)%' 3 | #csrf_protection: true 4 | #http_method_override: true 5 | 6 | # Enables session support. Note that the session will ONLY be started if you read or write from it. 7 | # Remove or comment this section to explicitly disable session support. 8 | session: 9 | handler_id: null 10 | storage_factory_id: 'session.storage.factory.native' 11 | cookie_secure: auto 12 | cookie_samesite: lax 13 | 14 | #esi: true 15 | #fragments: true 16 | php_errors: 17 | log: true 18 | 19 | assets: 20 | version: 'v1' 21 | -------------------------------------------------------------------------------- /config/packages/mailer.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | mailer: 3 | dsn: '%env(MAILER_DSN)%' 4 | -------------------------------------------------------------------------------- /config/packages/nelmio_api_doc.yaml: -------------------------------------------------------------------------------- 1 | nelmio_api_doc: 2 | models: { use_jms: false } 3 | 4 | documentation: 5 | openapi: '3.0.0' 6 | info: 7 | title: Repman 8 | description: Private PHP Package Repository Manager 9 | version: 1.0.0 10 | servers: 11 | - url: '%url_scheme%://%env(default:domain:APP_PUBLIC_HOST)%' 12 | description: API 13 | components: 14 | securitySchemes: 15 | ApiToken: 16 | type: apiKey 17 | in: header 18 | name: X-API-TOKEN 19 | security: 20 | - ApiToken: [] 21 | areas: 22 | path_patterns: 23 | - ^/api(?!/doc) 24 | -------------------------------------------------------------------------------- /config/packages/nelmio_cors.yaml: -------------------------------------------------------------------------------- 1 | nelmio_cors: 2 | defaults: 3 | allow_credentials: false 4 | allow_origin: [] 5 | allow_headers: [] 6 | allow_methods: [] 7 | expose_headers: [] 8 | max_age: 0 9 | hosts: [] 10 | origin_regex: false 11 | forced_allow_origin_value: ~ 12 | paths: 13 | '^/api': 14 | allow_origin: ['*'] 15 | allow_headers: ['*'] 16 | allow_methods: ['POST', 'PUT', 'PATCH', 'GET', 'DELETE'] 17 | max_age: 3600 18 | -------------------------------------------------------------------------------- /config/packages/nyholm_psr7.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | # Register nyholm/psr7 services for autowiring with PSR-17 (HTTP factories) 3 | Psr\Http\Message\RequestFactoryInterface: '@nyholm.psr7.psr17_factory' 4 | Psr\Http\Message\ResponseFactoryInterface: '@nyholm.psr7.psr17_factory' 5 | Psr\Http\Message\ServerRequestFactoryInterface: '@nyholm.psr7.psr17_factory' 6 | Psr\Http\Message\StreamFactoryInterface: '@nyholm.psr7.psr17_factory' 7 | Psr\Http\Message\UploadedFileFactoryInterface: '@nyholm.psr7.psr17_factory' 8 | Psr\Http\Message\UriFactoryInterface: '@nyholm.psr7.psr17_factory' 9 | 10 | # Register nyholm/psr7 services for autowiring with HTTPlug factories 11 | Http\Message\MessageFactory: '@nyholm.psr7.httplug_factory' 12 | Http\Message\RequestFactory: '@nyholm.psr7.httplug_factory' 13 | Http\Message\ResponseFactory: '@nyholm.psr7.httplug_factory' 14 | Http\Message\StreamFactory: '@nyholm.psr7.httplug_factory' 15 | Http\Message\UriFactory: '@nyholm.psr7.httplug_factory' 16 | 17 | nyholm.psr7.psr17_factory: 18 | class: Nyholm\Psr7\Factory\Psr17Factory 19 | 20 | nyholm.psr7.httplug_factory: 21 | class: Nyholm\Psr7\Factory\HttplugFactory 22 | -------------------------------------------------------------------------------- /config/packages/prod/doctrine.yaml: -------------------------------------------------------------------------------- 1 | doctrine: 2 | orm: 3 | auto_generate_proxy_classes: false 4 | metadata_cache_driver: 5 | type: pool 6 | pool: doctrine.system_cache_pool 7 | query_cache_driver: 8 | type: pool 9 | pool: doctrine.system_cache_pool 10 | result_cache_driver: 11 | type: pool 12 | pool: doctrine.result_cache_pool 13 | 14 | framework: 15 | cache: 16 | pools: 17 | doctrine.result_cache_pool: 18 | adapter: cache.app 19 | doctrine.system_cache_pool: 20 | adapter: cache.system 21 | -------------------------------------------------------------------------------- /config/packages/prod/routing.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | router: 3 | strict_requirements: null 4 | -------------------------------------------------------------------------------- /config/packages/prod/sentry.yaml: -------------------------------------------------------------------------------- 1 | sentry: 2 | dsn: '%env(SENTRY_DSN)%' 3 | options: 4 | release: '%env(string:default:kernel_version:APP_VERSION)%' 5 | integrations: 6 | - 'Sentry\Integration\IgnoreErrorsIntegration' 7 | -------------------------------------------------------------------------------- /config/packages/routing.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | router: 3 | utf8: true 4 | -------------------------------------------------------------------------------- /config/packages/sensio_framework_extra.yaml: -------------------------------------------------------------------------------- 1 | sensio_framework_extra: 2 | router: 3 | annotations: false 4 | -------------------------------------------------------------------------------- /config/packages/test/dama_doctrine_test_bundle.yaml: -------------------------------------------------------------------------------- 1 | dama_doctrine_test: 2 | enable_static_connection: true 3 | enable_static_meta_data_cache: true 4 | enable_static_query_cache: true 5 | -------------------------------------------------------------------------------- /config/packages/test/ewz_recaptcha.yaml: -------------------------------------------------------------------------------- 1 | ewz_recaptcha: 2 | enabled: false 3 | -------------------------------------------------------------------------------- /config/packages/test/flysystem.yaml: -------------------------------------------------------------------------------- 1 | 2 | flysystem: 3 | storages: 4 | storage.memory.proxy: 5 | adapter: 'local' 6 | options: 7 | directory: '%dists_dir%' 8 | 9 | storage.local.repo: 10 | adapter: 'local' 11 | options: 12 | directory: '%repo_dir%' 13 | 14 | repo.storage: 15 | adapter: 'lazy' 16 | options: 17 | source: 'storage.local.repo' 18 | 19 | proxy.storage: 20 | adapter: 'lazy' 21 | options: 22 | source: 'storage.local.proxy' 23 | -------------------------------------------------------------------------------- /config/packages/test/framework.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | test: true 3 | session: 4 | storage_factory_id: session.storage.factory.mock_file 5 | -------------------------------------------------------------------------------- /config/packages/test/knpu_oauth2_client.yaml: -------------------------------------------------------------------------------- 1 | knpu_oauth2_client: 2 | http_client: Buddy\Repman\Tests\Doubles\HttpClientStub 3 | -------------------------------------------------------------------------------- /config/packages/test/mailer.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | mailer: 3 | dsn: 'null://null' 4 | -------------------------------------------------------------------------------- /config/packages/test/messenger.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | messenger: 3 | transports: 4 | async: 'in-memory:///' 5 | sync: 'sync://' 6 | routing: 7 | 'Buddy\Repman\Message\User\SendPasswordResetLink': sync 8 | 'Buddy\Repman\Message\User\SendConfirmToken': sync 9 | 'Buddy\Repman\Message\Organization\SynchronizePackage': sync 10 | 'Buddy\Repman\Message\Admin\AddTechnicalEmail': sync 11 | 'Buddy\Repman\Message\Admin\RemoveTechnicalEmail': sync 12 | -------------------------------------------------------------------------------- /config/packages/test/monolog.yaml: -------------------------------------------------------------------------------- 1 | monolog: 2 | handlers: 3 | main: 4 | type: fingers_crossed 5 | action_level: error 6 | handler: nested 7 | excluded_http_codes: [404, 405] 8 | channels: ["!event"] 9 | nested: 10 | type: stream 11 | path: "%kernel.logs_dir%/%kernel.environment%.log" 12 | level: debug 13 | -------------------------------------------------------------------------------- /config/packages/test/security.yaml: -------------------------------------------------------------------------------- 1 | security: 2 | encoders: 3 | Buddy\Repman\Security\Model\User: 4 | algorithm: plaintext 5 | firewalls: 6 | main: 7 | http_basic: ~ 8 | -------------------------------------------------------------------------------- /config/packages/test/twig.yaml: -------------------------------------------------------------------------------- 1 | twig: 2 | strict_variables: true 3 | -------------------------------------------------------------------------------- /config/packages/test/validator.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | validation: 3 | not_compromised_password: false 4 | -------------------------------------------------------------------------------- /config/packages/test/web_profiler.yaml: -------------------------------------------------------------------------------- 1 | web_profiler: 2 | toolbar: false 3 | intercept_redirects: false 4 | 5 | framework: 6 | profiler: { collect: false } 7 | -------------------------------------------------------------------------------- /config/packages/twig.yaml: -------------------------------------------------------------------------------- 1 | twig: 2 | default_path: '%kernel.project_dir%/templates' 3 | form_themes: ['form/bootstrap_4_layout.html.twig'] 4 | paths: 5 | '%kernel.project_dir%/public': public 6 | globals: 7 | ga_tracking: '%env(resolve:GA_TRACKING)%' 8 | ga4_tracking: '%env(resolve:GA4_TRACKING)%' 9 | config: '@Buddy\Repman\Service\Config' 10 | -------------------------------------------------------------------------------- /config/packages/validator.yaml: -------------------------------------------------------------------------------- 1 | framework: 2 | validation: 3 | email_validation_mode: html5 4 | 5 | # Enables validator auto-mapping support. 6 | # For instance, basic validation constraints will be inferred from Doctrine's metadata. 7 | #auto_mapping: 8 | # App\Entity\: [] 9 | -------------------------------------------------------------------------------- /config/preload.php: -------------------------------------------------------------------------------- 1 | handle($request); 27 | $response->send(); 28 | $kernel->terminate($request, $response); 29 | -------------------------------------------------------------------------------- /public/repman-horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repman-io/repman/34e223a3de67e011a7619496c31eac33fb016e83/public/repman-horizontal.png -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | -------------------------------------------------------------------------------- /src/Controller/IndexController.php: -------------------------------------------------------------------------------- 1 | telemetry = $telemetry; 20 | } 21 | 22 | /** 23 | * @Route(path="/", name="index", methods={"GET"}) 24 | */ 25 | public function index(Request $request): Response 26 | { 27 | if ($request->getSession()->has('organization-token')) { 28 | return $this->redirectToRoute('organization_accept_invitation', ['token' => $request->getSession()->remove('organization-token')]); 29 | } 30 | 31 | return $this->render('index.html.twig', [ 32 | 'showTelemetryPrompt' => !$this->telemetry->isInstanceIdPresent(), 33 | 'telemetryDocsUrl' => $this->telemetry->docsUrl(), 34 | ]); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/DataFixtures/UserFixtures.php: -------------------------------------------------------------------------------- 1 | messageBus = $messageBus; 20 | } 21 | 22 | public function load(ObjectManager $manager): void 23 | { 24 | for ($i = 0; $i < 20; ++$i) { 25 | $this->messageBus->dispatch(new CreateUser( 26 | Uuid::uuid4()->toString(), 27 | uniqid().'@buddy.works', 28 | 'secret123', 29 | Uuid::uuid4()->toString(), 30 | ['ROLE_USER'] 31 | )); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Entity/Config.php: -------------------------------------------------------------------------------- 1 | value = $value; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Entity/Organization/Package/Metadata.php: -------------------------------------------------------------------------------- 1 | $options 22 | */ 23 | public function buildForm(FormBuilderInterface $builder, array $options): void 24 | { 25 | $builder 26 | ->add('name', TextType::class, [ 27 | 'constraints' => [ 28 | new NotBlank(), 29 | new Length(['max' => 255]), 30 | ], 31 | 'documentation' => [ 32 | 'maxLength' => 255, 33 | ], 34 | ]); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Form/Type/Organization/ChangeAnonymousAccessType.php: -------------------------------------------------------------------------------- 1 | $options 21 | */ 22 | public function buildForm(FormBuilderInterface $builder, array $options): void 23 | { 24 | $builder 25 | ->add('hasAnonymousAccess', CheckboxType::class, [ 26 | 'label' => 'Allow anonymous users', 27 | 'required' => false, 28 | ]) 29 | ->add('changeAnonymousAccess', SubmitType::class, ['label' => 'Change']) 30 | ; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Form/Type/Organization/ChangeNameType.php: -------------------------------------------------------------------------------- 1 | $options 23 | */ 24 | public function buildForm(FormBuilderInterface $builder, array $options): void 25 | { 26 | $builder 27 | ->add('name', TextType::class, [ 28 | 'constraints' => [ 29 | new NotBlank(), 30 | new Length([ 31 | 'max' => 80, 32 | ]), 33 | ], 34 | ]) 35 | ->add('Rename', SubmitType::class) 36 | ; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Form/Type/Organization/GenerateApiTokenType.php: -------------------------------------------------------------------------------- 1 | $options 23 | */ 24 | public function buildForm(FormBuilderInterface $builder, array $options): void 25 | { 26 | $builder 27 | ->add('name', TextType::class, [ 28 | 'constraints' => [ 29 | new NotBlank(), 30 | new Length(['max' => 255]), 31 | ], 32 | ]) 33 | ->add('Generate', SubmitType::class); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Form/Type/Organization/GenerateTokenType.php: -------------------------------------------------------------------------------- 1 | $options 23 | */ 24 | public function buildForm(FormBuilderInterface $builder, array $options): void 25 | { 26 | $builder 27 | ->add('name', TextType::class, [ 28 | 'constraints' => [ 29 | new NotBlank(), 30 | new Length(['max' => 255]), 31 | ], 32 | ]) 33 | ->add('Generate', SubmitType::class); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Form/Type/User/ChangeEmailPreferencesType.php: -------------------------------------------------------------------------------- 1 | $options 21 | */ 22 | public function buildForm(FormBuilderInterface $builder, array $options): void 23 | { 24 | $builder 25 | ->add('emailScanResult', CheckboxType::class, [ 26 | 'label' => 'Security scan results', 27 | 'required' => false, 28 | ]) 29 | ->add('changeEmailPreferences', SubmitType::class, ['label' => 'Update']) 30 | ; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Form/Type/User/ChangeRolesType.php: -------------------------------------------------------------------------------- 1 | $options 21 | */ 22 | public function buildForm(FormBuilderInterface $builder, array $options): void 23 | { 24 | $builder 25 | ->add('admin', CheckboxType::class, [ 26 | 'required' => false, 27 | 'label' => 'Administrator', 28 | 'help' => 'allows access to additional administrative functions', 29 | ]) 30 | ->add('save', SubmitType::class, ['label' => 'Change roles']) 31 | ; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Form/Type/User/SendResetPasswordLinkType.php: -------------------------------------------------------------------------------- 1 | $options 23 | */ 24 | public function buildForm(FormBuilderInterface $builder, array $options): void 25 | { 26 | $builder 27 | ->add('email', EmailType::class, ['constraints' => [ 28 | new NotNull(), 29 | new Email(['mode' => 'html5']), 30 | ]]) 31 | ->add('send', SubmitType::class, ['label' => 'Email me a password reset link', 'attr' => ['class' => 'btn-primary btn-block']]) 32 | ; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Message/Admin/AddTechnicalEmail.php: -------------------------------------------------------------------------------- 1 | email = $email; 14 | } 15 | 16 | public function email(): string 17 | { 18 | return $this->email; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/Admin/ChangeConfig.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | private array $values; 13 | 14 | /** 15 | * @param array $values 16 | */ 17 | public function __construct(array $values) 18 | { 19 | $this->values = $values; 20 | } 21 | 22 | /** 23 | * @return array 24 | */ 25 | public function values(): array 26 | { 27 | return $this->values; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Message/Admin/RemoveTechnicalEmail.php: -------------------------------------------------------------------------------- 1 | email = $email; 14 | } 15 | 16 | public function email(): string 17 | { 18 | return $this->email; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/Organization/AddDownload.php: -------------------------------------------------------------------------------- 1 | packageId = $packageId; 18 | $this->version = $version; 19 | $this->date = $date; 20 | $this->ip = $ip; 21 | $this->userAgent = $userAgent; 22 | } 23 | 24 | public function packageId(): string 25 | { 26 | return $this->packageId; 27 | } 28 | 29 | public function version(): string 30 | { 31 | return $this->version; 32 | } 33 | 34 | public function date(): \DateTimeImmutable 35 | { 36 | return $this->date; 37 | } 38 | 39 | public function ip(): ?string 40 | { 41 | return $this->ip; 42 | } 43 | 44 | public function userAgent(): ?string 45 | { 46 | return $this->userAgent; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Message/Organization/ChangeAlias.php: -------------------------------------------------------------------------------- 1 | organizationId = $organizationId; 15 | $this->alias = $alias; 16 | } 17 | 18 | public function organizationId(): string 19 | { 20 | return $this->organizationId; 21 | } 22 | 23 | public function alias(): string 24 | { 25 | return $this->alias; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/Organization/ChangeAnonymousAccess.php: -------------------------------------------------------------------------------- 1 | organizationId = $organizationId; 15 | $this->hasAnonymousAccess = $hasAnonymousAccess; 16 | } 17 | 18 | public function organizationId(): string 19 | { 20 | return $this->organizationId; 21 | } 22 | 23 | public function hasAnonymousAccess(): bool 24 | { 25 | return $this->hasAnonymousAccess; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/Organization/ChangeName.php: -------------------------------------------------------------------------------- 1 | organizationId = $organizationId; 15 | $this->name = $name; 16 | } 17 | 18 | public function organizationId(): string 19 | { 20 | return $this->organizationId; 21 | } 22 | 23 | public function name(): string 24 | { 25 | return $this->name; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/Organization/CreateOrganization.php: -------------------------------------------------------------------------------- 1 | id = $id; 16 | $this->ownerId = $ownerId; 17 | $this->name = $name; 18 | } 19 | 20 | public function id(): string 21 | { 22 | return $this->id; 23 | } 24 | 25 | public function ownerId(): string 26 | { 27 | return $this->ownerId; 28 | } 29 | 30 | public function name(): string 31 | { 32 | return $this->name; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Message/Organization/GenerateToken.php: -------------------------------------------------------------------------------- 1 | organizationId = $organizationId; 15 | $this->name = $name; 16 | } 17 | 18 | public function organizationId(): string 19 | { 20 | return $this->organizationId; 21 | } 22 | 23 | public function name(): string 24 | { 25 | return $this->name; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/Organization/Member/AcceptInvitation.php: -------------------------------------------------------------------------------- 1 | token = $token; 15 | $this->userId = $userId; 16 | } 17 | 18 | public function token(): string 19 | { 20 | return $this->token; 21 | } 22 | 23 | public function userId(): string 24 | { 25 | return $this->userId; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/Organization/Member/ChangeRole.php: -------------------------------------------------------------------------------- 1 | organizationId = $organizationId; 16 | $this->userId = $userId; 17 | $this->role = $role; 18 | } 19 | 20 | public function organizationId(): string 21 | { 22 | return $this->organizationId; 23 | } 24 | 25 | public function userId(): string 26 | { 27 | return $this->userId; 28 | } 29 | 30 | public function role(): string 31 | { 32 | return $this->role; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Message/Organization/Member/InviteUser.php: -------------------------------------------------------------------------------- 1 | email = $email; 17 | $this->role = $role; 18 | $this->organizationId = $organizationId; 19 | $this->token = $token; 20 | } 21 | 22 | public function email(): string 23 | { 24 | return $this->email; 25 | } 26 | 27 | public function role(): string 28 | { 29 | return $this->role; 30 | } 31 | 32 | public function organizationId(): string 33 | { 34 | return $this->organizationId; 35 | } 36 | 37 | public function token(): string 38 | { 39 | return $this->token; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Message/Organization/Member/RemoveInvitation.php: -------------------------------------------------------------------------------- 1 | organizationId = $organizationId; 15 | $this->token = $token; 16 | } 17 | 18 | public function organizationId(): string 19 | { 20 | return $this->organizationId; 21 | } 22 | 23 | public function token(): string 24 | { 25 | return $this->token; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/Organization/Member/RemoveMember.php: -------------------------------------------------------------------------------- 1 | organizationId = $organizationId; 15 | $this->userId = $userId; 16 | } 17 | 18 | public function organizationId(): string 19 | { 20 | return $this->organizationId; 21 | } 22 | 23 | public function userId(): string 24 | { 25 | return $this->userId; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/Organization/Package/AddBitbucketHook.php: -------------------------------------------------------------------------------- 1 | packageId = $packageId; 14 | } 15 | 16 | public function packageId(): string 17 | { 18 | return $this->packageId; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/Organization/Package/AddGitHubHook.php: -------------------------------------------------------------------------------- 1 | packageId = $packageId; 14 | } 15 | 16 | public function packageId(): string 17 | { 18 | return $this->packageId; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/Organization/Package/AddGitLabHook.php: -------------------------------------------------------------------------------- 1 | packageId = $packageId; 14 | } 15 | 16 | public function packageId(): string 17 | { 18 | return $this->packageId; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/Organization/Package/RemoveBitbucketHook.php: -------------------------------------------------------------------------------- 1 | packageId = $packageId; 14 | } 15 | 16 | public function packageId(): string 17 | { 18 | return $this->packageId; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/Organization/Package/RemoveGitHubHook.php: -------------------------------------------------------------------------------- 1 | packageId = $packageId; 14 | } 15 | 16 | public function packageId(): string 17 | { 18 | return $this->packageId; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/Organization/Package/RemoveGitLabHook.php: -------------------------------------------------------------------------------- 1 | packageId = $packageId; 14 | } 15 | 16 | public function packageId(): string 17 | { 18 | return $this->packageId; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/Organization/Package/Update.php: -------------------------------------------------------------------------------- 1 | packageId = $packageId; 17 | $this->url = $url; 18 | $this->keepLastReleases = $keepLastReleases; 19 | $this->enableSecurityScan = $enableSecurityScan; 20 | } 21 | 22 | public function packageId(): string 23 | { 24 | return $this->packageId; 25 | } 26 | 27 | public function url(): string 28 | { 29 | return $this->url; 30 | } 31 | 32 | public function keepLastReleases(): int 33 | { 34 | return $this->keepLastReleases; 35 | } 36 | 37 | public function isEnabledSecurityScan(): bool 38 | { 39 | return $this->enableSecurityScan; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Message/Organization/RegenerateToken.php: -------------------------------------------------------------------------------- 1 | organizationId = $organizationId; 15 | $this->token = $token; 16 | } 17 | 18 | public function organizationId(): string 19 | { 20 | return $this->organizationId; 21 | } 22 | 23 | public function token(): string 24 | { 25 | return $this->token; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/Organization/RemoveOrganization.php: -------------------------------------------------------------------------------- 1 | id = $id; 14 | } 15 | 16 | public function id(): string 17 | { 18 | return $this->id; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/Organization/RemovePackage.php: -------------------------------------------------------------------------------- 1 | id = $id; 15 | $this->organizationId = $organizationId; 16 | } 17 | 18 | public function id(): string 19 | { 20 | return $this->id; 21 | } 22 | 23 | public function organizationId(): string 24 | { 25 | return $this->organizationId; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/Organization/RemoveToken.php: -------------------------------------------------------------------------------- 1 | organizationId = $organizationId; 15 | $this->token = $token; 16 | } 17 | 18 | public function organizationId(): string 19 | { 20 | return $this->organizationId; 21 | } 22 | 23 | public function token(): string 24 | { 25 | return $this->token; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/Organization/SynchronizePackage.php: -------------------------------------------------------------------------------- 1 | id = $id; 14 | } 15 | 16 | public function id(): string 17 | { 18 | return $this->id; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/Proxy/AddDownloads.php: -------------------------------------------------------------------------------- 1 | packages = $packages; 25 | $this->date = $date; 26 | $this->ip = $ip; 27 | $this->userAgent = $userAgent; 28 | } 29 | 30 | /** 31 | * @return Package[] 32 | */ 33 | public function packages(): array 34 | { 35 | return $this->packages; 36 | } 37 | 38 | public function date(): \DateTimeImmutable 39 | { 40 | return $this->date; 41 | } 42 | 43 | public function ip(): ?string 44 | { 45 | return $this->ip; 46 | } 47 | 48 | public function userAgent(): ?string 49 | { 50 | return $this->userAgent; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Message/Proxy/AddDownloads/Package.php: -------------------------------------------------------------------------------- 1 | name = $name; 15 | $this->version = $version; 16 | } 17 | 18 | public function name(): string 19 | { 20 | return $this->name; 21 | } 22 | 23 | public function version(): string 24 | { 25 | return $this->version; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/Proxy/RemoveDist.php: -------------------------------------------------------------------------------- 1 | proxy = $proxy; 15 | $this->packageName = $packageName; 16 | } 17 | 18 | public function proxy(): string 19 | { 20 | return $this->proxy; 21 | } 22 | 23 | public function packageName(): string 24 | { 25 | return $this->packageName; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/Security/ScanPackage.php: -------------------------------------------------------------------------------- 1 | id = $id; 14 | } 15 | 16 | public function id(): string 17 | { 18 | return $this->id; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/User/ChangeEmailPreferences.php: -------------------------------------------------------------------------------- 1 | userId = $userId; 15 | $this->emailScanResult = $emailScanResult; 16 | } 17 | 18 | public function userId(): string 19 | { 20 | return $this->userId; 21 | } 22 | 23 | public function emailScanResult(): bool 24 | { 25 | return $this->emailScanResult; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/User/ChangePassword.php: -------------------------------------------------------------------------------- 1 | userId = $userId; 15 | $this->plainPassword = $plainPassword; 16 | } 17 | 18 | public function userId(): string 19 | { 20 | return $this->userId; 21 | } 22 | 23 | public function plainPassword(): string 24 | { 25 | return $this->plainPassword; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/User/ChangeRoles.php: -------------------------------------------------------------------------------- 1 | userId = $userId; 22 | $this->roles = $roles; 23 | } 24 | 25 | public function userId(): string 26 | { 27 | return $this->userId; 28 | } 29 | 30 | /** 31 | * @return string[] 32 | */ 33 | public function roles(): array 34 | { 35 | return $this->roles; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Message/User/ChangeTimezone.php: -------------------------------------------------------------------------------- 1 | userId = $userId; 15 | $this->timezone = $timezone; 16 | } 17 | 18 | public function userId(): string 19 | { 20 | return $this->userId; 21 | } 22 | 23 | public function timezone(): string 24 | { 25 | return $this->timezone; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/User/ConfirmEmail.php: -------------------------------------------------------------------------------- 1 | token = $token; 14 | } 15 | 16 | public function token(): string 17 | { 18 | return $this->token; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/User/CreateOAuthUser.php: -------------------------------------------------------------------------------- 1 | email = $email; 14 | } 15 | 16 | public function email(): string 17 | { 18 | return $this->email; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/User/DisableUser.php: -------------------------------------------------------------------------------- 1 | id = $id; 14 | } 15 | 16 | public function id(): string 17 | { 18 | return $this->id; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/User/EnableUser.php: -------------------------------------------------------------------------------- 1 | id = $id; 14 | } 15 | 16 | public function id(): string 17 | { 18 | return $this->id; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/User/GenerateApiToken.php: -------------------------------------------------------------------------------- 1 | userId = $userId; 15 | $this->name = $name; 16 | } 17 | 18 | public function userId(): string 19 | { 20 | return $this->userId; 21 | } 22 | 23 | public function name(): string 24 | { 25 | return $this->name; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/User/RegenerateApiToken.php: -------------------------------------------------------------------------------- 1 | userId = $userId; 15 | $this->token = $token; 16 | } 17 | 18 | public function userId(): string 19 | { 20 | return $this->userId; 21 | } 22 | 23 | public function token(): string 24 | { 25 | return $this->token; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/User/RemoveApiToken.php: -------------------------------------------------------------------------------- 1 | userId = $userId; 15 | $this->token = $token; 16 | } 17 | 18 | public function userId(): string 19 | { 20 | return $this->userId; 21 | } 22 | 23 | public function token(): string 24 | { 25 | return $this->token; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/User/RemoveOAuthToken.php: -------------------------------------------------------------------------------- 1 | userId = $userId; 15 | $this->type = $type; 16 | } 17 | 18 | public function userId(): string 19 | { 20 | return $this->userId; 21 | } 22 | 23 | public function type(): string 24 | { 25 | return $this->type; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/User/RemoveUser.php: -------------------------------------------------------------------------------- 1 | id = $id; 14 | } 15 | 16 | public function id(): string 17 | { 18 | return $this->id; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Message/User/ResetPassword.php: -------------------------------------------------------------------------------- 1 | token = $token; 15 | $this->password = $password; 16 | } 17 | 18 | public function token(): string 19 | { 20 | return $this->token; 21 | } 22 | 23 | public function password(): string 24 | { 25 | return $this->password; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/User/SendConfirmToken.php: -------------------------------------------------------------------------------- 1 | email = $email; 15 | $this->token = $token; 16 | } 17 | 18 | public function email(): string 19 | { 20 | return $this->email; 21 | } 22 | 23 | public function token(): string 24 | { 25 | return $this->token; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Message/User/SendPasswordResetLink.php: -------------------------------------------------------------------------------- 1 | email = $email; 16 | $this->operatingSystem = $operatingSystem; 17 | $this->browser = $browser; 18 | } 19 | 20 | public function email(): string 21 | { 22 | return $this->email; 23 | } 24 | 25 | public function operatingSystem(): string 26 | { 27 | return $this->operatingSystem; 28 | } 29 | 30 | public function browser(): string 31 | { 32 | return $this->browser; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/MessageHandler/Admin/AddTechnicalEmailHandler.php: -------------------------------------------------------------------------------- 1 | telemetry = $telemetry; 18 | } 19 | 20 | public function __invoke(AddTechnicalEmail $message): void 21 | { 22 | $this->telemetry->addTechnicalEmail($message->email()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/MessageHandler/Admin/RemoveTechnicalEmailHandler.php: -------------------------------------------------------------------------------- 1 | telemetry = $telemetry; 18 | } 19 | 20 | public function __invoke(RemoveTechnicalEmail $message): void 21 | { 22 | $this->telemetry->removeTechnicalEmail($message->email()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/AddDownloadHandler.php: -------------------------------------------------------------------------------- 1 | packages = $packages; 20 | } 21 | 22 | public function __invoke(AddDownload $message): void 23 | { 24 | $this->packages->addDownload(new Download( 25 | Uuid::uuid4(), 26 | Uuid::fromString($message->packageId()), 27 | $message->date(), 28 | $message->version(), 29 | $message->ip(), 30 | $message->userAgent() !== null ? substr($message->userAgent(), 0, 255) : null 31 | )); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/AddPackageHandler.php: -------------------------------------------------------------------------------- 1 | organizations = $organizations; 20 | } 21 | 22 | public function __invoke(AddPackage $message): void 23 | { 24 | $this->organizations 25 | ->getById(Uuid::fromString($message->organizationId())) 26 | ->addPackage( 27 | new Package( 28 | Uuid::fromString($message->id()), 29 | $message->type(), 30 | $message->url(), 31 | $message->metadata(), 32 | $message->keepLastReleases() 33 | ) 34 | ) 35 | ; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/ChangeAliasHandler.php: -------------------------------------------------------------------------------- 1 | repositories = $repositories; 19 | } 20 | 21 | public function __invoke(ChangeAlias $message): void 22 | { 23 | $this->repositories 24 | ->getById(Uuid::fromString($message->organizationId())) 25 | ->changeAlias($message->alias()) 26 | ; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/ChangeAnonymousAccessHandler.php: -------------------------------------------------------------------------------- 1 | repositories = $repositories; 19 | } 20 | 21 | public function __invoke(ChangeAnonymousAccess $message): void 22 | { 23 | $this->repositories 24 | ->getById(Uuid::fromString($message->organizationId())) 25 | ->changeAnonymousAccess($message->hasAnonymousAccess()) 26 | ; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/ChangeNameHandler.php: -------------------------------------------------------------------------------- 1 | repositories = $repositories; 19 | } 20 | 21 | public function __invoke(ChangeName $message): void 22 | { 23 | $this->repositories 24 | ->getById(Uuid::fromString($message->organizationId())) 25 | ->changeName($message->name()) 26 | ; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/GenerateTokenHandler.php: -------------------------------------------------------------------------------- 1 | organizations = $organizations; 22 | $this->tokenGenerator = $tokenGenerator; 23 | } 24 | 25 | public function __invoke(GenerateToken $message): void 26 | { 27 | $this->organizations 28 | ->getById(Uuid::fromString($message->organizationId())) 29 | ->addToken(new Token( 30 | $this->tokenGenerator->generate(), 31 | $message->name() 32 | )) 33 | ; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/Member/AcceptInvitationHandler.php: -------------------------------------------------------------------------------- 1 | organizations = $organizations; 21 | $this->users = $users; 22 | } 23 | 24 | public function __invoke(AcceptInvitation $message): void 25 | { 26 | $this->organizations 27 | ->getByInvitationToken($message->token()) 28 | ->acceptInvitation($message->token(), $this->users->getById(Uuid::fromString($message->userId()))); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/Member/ChangeRoleHandler.php: -------------------------------------------------------------------------------- 1 | organizations = $organizations; 21 | $this->users = $users; 22 | } 23 | 24 | public function __invoke(ChangeRole $message): void 25 | { 26 | $this->organizations 27 | ->getById(Uuid::fromString($message->organizationId())) 28 | ->changeRole( 29 | $this->users->getById(Uuid::fromString($message->userId())), 30 | $message->role() 31 | ) 32 | ; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/Member/InviteUserHandler.php: -------------------------------------------------------------------------------- 1 | organizations = $organizations; 21 | $this->mailer = $mailer; 22 | } 23 | 24 | public function __invoke(InviteUser $message): void 25 | { 26 | $organization = $this->organizations->getById(Uuid::fromString($message->organizationId())); 27 | if ($organization->inviteUser($message->email(), $message->role(), $message->token())) { 28 | $this->mailer->sendInvitationToOrganization($message->email(), $message->token(), $organization->name()); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/Member/RemoveInvitationHandler.php: -------------------------------------------------------------------------------- 1 | organizations = $organizations; 19 | } 20 | 21 | public function __invoke(RemoveInvitation $message): void 22 | { 23 | $this->organizations 24 | ->getById(Uuid::fromString($message->organizationId())) 25 | ->removeInvitation($message->token()) 26 | ; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/Member/RemoveMemberHandler.php: -------------------------------------------------------------------------------- 1 | organizations = $organizations; 21 | $this->users = $users; 22 | } 23 | 24 | public function __invoke(RemoveMember $message): void 25 | { 26 | $this->organizations 27 | ->getById(Uuid::fromString($message->organizationId())) 28 | ->removeMember($this->users->getById(Uuid::fromString($message->userId()))) 29 | ; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/Package/AbstractHookHandler.php: -------------------------------------------------------------------------------- 1 | packages = $packages; 23 | $this->integrations = $integrations; 24 | $this->router = $router; 25 | $this->tokenRefresher = $tokenRefresher; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/Package/RemoveBitbucketHookHandler.php: -------------------------------------------------------------------------------- 1 | packages->getById(Uuid::fromString($message->packageId())); 17 | $this->integrations->bitbucketApi()->removeHook( 18 | $package->oauthToken()->accessToken($this->tokenRefresher), 19 | $package->metadata(Metadata::BITBUCKET_REPO_NAME), 20 | $this->router->generate('package_webhook', ['package' => $package->id()->toString()], UrlGeneratorInterface::ABSOLUTE_URL) 21 | ); 22 | $package->webhookWasRemoved(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/Package/RemoveGitHubHookHandler.php: -------------------------------------------------------------------------------- 1 | packages->getById(Uuid::fromString($message->packageId())); 17 | 18 | $this->integrations->gitHubApi()->removeHook( 19 | $package->oauthToken()->accessToken($this->tokenRefresher), 20 | $package->metadata(Metadata::GITHUB_REPO_NAME), 21 | $this->router->generate('package_webhook', ['package' => $package->id()->toString()], UrlGeneratorInterface::ABSOLUTE_URL) 22 | ); 23 | 24 | $package->webhookWasRemoved(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/Package/RemoveGitLabHookHandler.php: -------------------------------------------------------------------------------- 1 | packages->getById(Uuid::fromString($message->packageId())); 17 | $this->integrations->gitLabApi()->removeHook( 18 | $package->oauthToken()->accessToken($this->tokenRefresher), 19 | $package->metadata(Metadata::GITLAB_PROJECT_ID), 20 | $this->router->generate('package_webhook', ['package' => $package->id()->toString()], UrlGeneratorInterface::ABSOLUTE_URL) 21 | ); 22 | $package->webhookWasRemoved(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/Package/UpdateHandler.php: -------------------------------------------------------------------------------- 1 | packages = $packages; 20 | } 21 | 22 | public function __invoke(Update $message): void 23 | { 24 | $package = $this->packages->find(Uuid::fromString($message->packageId())); 25 | if (!$package instanceof Package) { 26 | return; 27 | } 28 | 29 | $package->update($message->url(), $message->keepLastReleases(), $message->isEnabledSecurityScan()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/RegenerateTokenHandler.php: -------------------------------------------------------------------------------- 1 | organizations = $organizations; 21 | $this->tokenGenerator = $tokenGenerator; 22 | } 23 | 24 | public function __invoke(RegenerateToken $message): void 25 | { 26 | $this->organizations 27 | ->getById(Uuid::fromString($message->organizationId())) 28 | ->regenerateToken($message->token(), $this->tokenGenerator->generate()) 29 | ; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/MessageHandler/Organization/RemoveTokenHandler.php: -------------------------------------------------------------------------------- 1 | organizations = $organizations; 19 | } 20 | 21 | public function __invoke(RemoveToken $message): void 22 | { 23 | $this->organizations 24 | ->getById(Uuid::fromString($message->organizationId())) 25 | ->removeToken($message->token()) 26 | ; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MessageHandler/Proxy/AddDownloadsHandler.php: -------------------------------------------------------------------------------- 1 | downloads = $downloads; 20 | } 21 | 22 | public function __invoke(AddDownloads $message): void 23 | { 24 | $this->downloads->save( 25 | array_map(function (MessagePackage $package): Package { 26 | return new Package($package->name(), $package->version()); 27 | }, $message->packages()), 28 | $message->date(), 29 | $message->ip(), 30 | $message->userAgent() 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/MessageHandler/Proxy/RemoveDistHandler.php: -------------------------------------------------------------------------------- 1 | register = $register; 18 | } 19 | 20 | public function __invoke(RemoveDist $message): void 21 | { 22 | $this->register->getByHost($message->proxy())->removeDist($message->packageName()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/MessageHandler/Security/ScanPackageHandler.php: -------------------------------------------------------------------------------- 1 | scanner = $scanner; 22 | $this->packages = $packages; 23 | } 24 | 25 | public function __invoke(ScanPackage $message): void 26 | { 27 | $package = $this->packages->find(Uuid::fromString($message->id())); 28 | if (!$package instanceof Package) { 29 | return; 30 | } 31 | if (!$package->isEnabledSecurityScan()) { 32 | return; 33 | } 34 | 35 | $this->scanner->scan($package); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/MessageHandler/Security/SendScanResultHandler.php: -------------------------------------------------------------------------------- 1 | mailer = $mailer; 18 | } 19 | 20 | public function __invoke(SendScanResult $message): void 21 | { 22 | $this->mailer->sendScanResult( 23 | $message->emails(), 24 | $message->packageName(), 25 | $message->packageId(), 26 | $message->organizationAlias(), 27 | $message->result() 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/MessageHandler/User/AddOAuthTokenHandler.php: -------------------------------------------------------------------------------- 1 | users = $users; 20 | } 21 | 22 | public function __invoke(AddOAuthToken $message): void 23 | { 24 | $user = $this->users->getById(Uuid::fromString($message->userId())); 25 | $user->addOAuthToken( 26 | new OAuthToken( 27 | Uuid::fromString($message->id()), 28 | $user, 29 | $message->type(), 30 | $message->accessToken(), 31 | $message->refreshToken(), 32 | $message->expiresAt() 33 | ) 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/MessageHandler/User/ChangeEmailPreferencesHandler.php: -------------------------------------------------------------------------------- 1 | users = $users; 19 | } 20 | 21 | public function __invoke(ChangeEmailPreferences $message): void 22 | { 23 | $this->users->setEmailScanResult( 24 | Uuid::fromString($message->userId()), 25 | $message->emailScanResult() 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MessageHandler/User/ChangePasswordHandler.php: -------------------------------------------------------------------------------- 1 | users = $users; 22 | $this->hasherFactory = $hasherFactory; 23 | } 24 | 25 | public function __invoke(ChangePassword $message): void 26 | { 27 | $this->users->getById(Uuid::fromString($message->userId()))->changePassword( 28 | $this->hasherFactory->getPasswordHasher(User::class)->hash($message->plainPassword()) 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/MessageHandler/User/ChangeRolesHandler.php: -------------------------------------------------------------------------------- 1 | users = $users; 19 | } 20 | 21 | public function __invoke(ChangeRoles $message): void 22 | { 23 | $this->users->getById(Uuid::fromString($message->userId()))->changeRoles($message->roles()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/MessageHandler/User/ChangeTimezoneHandler.php: -------------------------------------------------------------------------------- 1 | users = $users; 19 | } 20 | 21 | public function __invoke(ChangeTimezone $message): void 22 | { 23 | $this->users 24 | ->getById(Uuid::fromString($message->userId())) 25 | ->changeTimezone($message->timezone()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/MessageHandler/User/ConfirmEmailHandler.php: -------------------------------------------------------------------------------- 1 | users = $users; 18 | } 19 | 20 | public function __invoke(ConfirmEmail $message): void 21 | { 22 | $this->users->getByConfirmEmailToken($message->token())->confirmEmail($message->token()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/MessageHandler/User/DisableUserHandler.php: -------------------------------------------------------------------------------- 1 | users = $users; 19 | } 20 | 21 | public function __invoke(DisableUser $message): void 22 | { 23 | $this 24 | ->users 25 | ->getById(Uuid::fromString($message->id())) 26 | ->disable(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MessageHandler/User/EnableUserHandler.php: -------------------------------------------------------------------------------- 1 | users = $users; 19 | } 20 | 21 | public function __invoke(EnableUser $message): void 22 | { 23 | $this 24 | ->users 25 | ->getById(Uuid::fromString($message->id())) 26 | ->enable(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MessageHandler/User/GenerateApiTokenHandler.php: -------------------------------------------------------------------------------- 1 | users = $users; 22 | $this->tokenGenerator = $tokenGenerator; 23 | } 24 | 25 | public function __invoke(GenerateApiToken $message): void 26 | { 27 | $this->users 28 | ->getById(Uuid::fromString($message->userId())) 29 | ->addApiToken(new ApiToken( 30 | $this->tokenGenerator->generate(), 31 | $message->name() 32 | )) 33 | ; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/MessageHandler/User/RegenerateApiTokenHandler.php: -------------------------------------------------------------------------------- 1 | users = $users; 21 | $this->tokenGenerator = $tokenGenerator; 22 | } 23 | 24 | public function __invoke(RegenerateApiToken $message): void 25 | { 26 | $this->users 27 | ->getById(Uuid::fromString($message->userId())) 28 | ->regenerateApiToken($message->token(), $this->tokenGenerator->generate()) 29 | ; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/MessageHandler/User/RemoveApiTokenHandler.php: -------------------------------------------------------------------------------- 1 | users = $users; 19 | } 20 | 21 | public function __invoke(RemoveApiToken $message): void 22 | { 23 | $this->users 24 | ->getById(Uuid::fromString($message->userId())) 25 | ->removeApiToken($message->token()) 26 | ; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/MessageHandler/User/RemoveOAuthTokenHandler.php: -------------------------------------------------------------------------------- 1 | users = $users; 19 | } 20 | 21 | public function __invoke(RemoveOAuthToken $message): void 22 | { 23 | $user = $this->users->getById(Uuid::fromString($message->userId())); 24 | $user->removeOAuthToken($message->type()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/MessageHandler/User/RemoveUserHandler.php: -------------------------------------------------------------------------------- 1 | users = $users; 19 | } 20 | 21 | public function __invoke(RemoveUser $message): void 22 | { 23 | $this 24 | ->users 25 | ->remove(Uuid::fromString($message->id())); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/MessageHandler/User/SendConfirmTokenHandler.php: -------------------------------------------------------------------------------- 1 | mailer = $mailer; 18 | } 19 | 20 | public function __invoke(SendConfirmToken $message): void 21 | { 22 | $this->mailer->sendEmailVerification($message->email(), $message->token()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Migrations/Factory/MigrationFactoryDecorator.php: -------------------------------------------------------------------------------- 1 | migrationFactory = $migrationFactory; 20 | $this->container = $container; 21 | } 22 | 23 | public function createVersion(string $migrationClassName): AbstractMigration 24 | { 25 | $instance = $this->migrationFactory->createVersion($migrationClassName); 26 | 27 | if ($instance instanceof ContainerAwareInterface) { 28 | $instance->setContainer($this->container); 29 | } 30 | 31 | return $instance; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Migrations/Version20200407141025.php: -------------------------------------------------------------------------------- 1 | addSql('CREATE TABLE proxy_package_download (package VARCHAR(255) NOT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE, version VARCHAR(255) NOT NULL, ip VARCHAR(15) DEFAULT NULL, user_agent VARCHAR(255) DEFAULT NULL)'); 23 | $this->addSql('CREATE INDEX proxy_package_idx ON proxy_package_download (package)'); 24 | $this->addSql('CREATE INDEX proxy_download_date_idx ON proxy_package_download (date)'); 25 | } 26 | 27 | public function down(Schema $schema): void 28 | { 29 | $this->addSql('DROP TABLE proxy_package_download'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Migrations/Version20200416051700.php: -------------------------------------------------------------------------------- 1 | addSql('CREATE TABLE organization_package_webhook_request (package_id UUID NOT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE, ip VARCHAR(15) DEFAULT NULL, user_agent VARCHAR(255) DEFAULT NULL)'); 23 | $this->addSql('CREATE INDEX organization_package_webhook_request_package_idx ON organization_package_webhook_request (package_id)'); 24 | $this->addSql('CREATE INDEX organization_package_webhook_request_date_idx ON organization_package_webhook_request (date)'); 25 | } 26 | 27 | public function down(Schema $schema): void 28 | { 29 | $this->addSql('DROP TABLE organization_package_webhook_request'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Migrations/Version20200422190543.php: -------------------------------------------------------------------------------- 1 | abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.'); 25 | $this->addSql('UPDATE "user" SET email = lower(email)'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Migrations/Version20200930164734.php: -------------------------------------------------------------------------------- 1 | addSql('ALTER TABLE organization_package ADD keep_last_releases INT DEFAULT 0 NOT NULL'); 24 | } 25 | 26 | public function down(Schema $schema): void 27 | { 28 | // this down() migration is auto-generated, please modify it to your needs 29 | $this->addSql('ALTER TABLE organization_package DROP keep_last_releases'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Migrations/Version20201007124214.php: -------------------------------------------------------------------------------- 1 | addSql(sprintf( 24 | 'ALTER TABLE "user" ADD timezone VARCHAR(255) NOT NULL DEFAULT \'%s\'', 25 | date_default_timezone_get() 26 | )); 27 | } 28 | 29 | public function down(Schema $schema): void 30 | { 31 | // this down() migration is auto-generated, please modify it to your needs 32 | $this->addSql('ALTER TABLE "user" DROP timezone'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Migrations/Version20201014155748.php: -------------------------------------------------------------------------------- 1 | addSql('ALTER TABLE "organization_package" ADD readme text default null'); 20 | } 21 | 22 | public function down(Schema $schema): void 23 | { 24 | $this->addSql('ALTER TABLE "organization_package" DROP readme'); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Migrations/Version20210128083706.php: -------------------------------------------------------------------------------- 1 | addSql('ALTER TABLE organization_package ALTER keep_last_releases DROP DEFAULT'); 24 | $this->addSql('ALTER TABLE "user" ALTER timezone DROP DEFAULT'); 25 | } 26 | 27 | public function down(Schema $schema): void 28 | { 29 | // this down() migration is auto-generated, please modify it to your needs 30 | $this->addSql('ALTER TABLE organization_package ALTER keep_last_releases SET DEFAULT 0'); 31 | $this->addSql('ALTER TABLE "user" ALTER timezone SET DEFAULT \'Europe/Berlin\''); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Migrations/Version20210129111835.php: -------------------------------------------------------------------------------- 1 | addSql('ALTER TABLE organization_package ADD webhook_created_error VARCHAR(255) DEFAULT NULL'); 24 | } 25 | 26 | public function down(Schema $schema): void 27 | { 28 | // this down() migration is auto-generated, please modify it to your needs 29 | $this->addSql('ALTER TABLE organization_package DROP webhook_created_error'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Migrations/Version20220220163835.php: -------------------------------------------------------------------------------- 1 | addSql('ALTER TABLE organization_package ADD replacement_package TEXT DEFAULT NULL'); 20 | } 21 | 22 | public function down(Schema $schema): void 23 | { 24 | $this->addSql('ALTER TABLE organization_package DROP replacement_package'); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Migrations/Version20220316201455.php: -------------------------------------------------------------------------------- 1 | addSql('ALTER TABLE organization_package ADD enable_security_scan BOOLEAN DEFAULT \'true\' NOT NULL'); 24 | } 25 | 26 | public function down(Schema $schema): void 27 | { 28 | // this down() migration is auto-generated, please modify it to your needs 29 | $this->addSql('ALTER TABLE organization_package DROP enable_security_scan'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Query/Admin/ConfigQuery.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | public function findAll(): array; 13 | } 14 | -------------------------------------------------------------------------------- /src/Query/Admin/ConfigQuery/DbalConfigQuery.php: -------------------------------------------------------------------------------- 1 | connection = $connection; 17 | } 18 | 19 | /** 20 | * @return array 21 | */ 22 | public function findAll(): array 23 | { 24 | $data = $this->connection->fetchAllAssociative('SELECT key, value FROM config'); 25 | $values = []; 26 | foreach ($data as $row) { 27 | $values[(string) $row['key']] = $row['value']; 28 | } 29 | 30 | return $values; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Query/Admin/Model/Organization.php: -------------------------------------------------------------------------------- 1 | id = $id; 17 | $this->name = $name; 18 | $this->alias = $alias; 19 | $this->packagesCount = $packagesCount; 20 | } 21 | 22 | public function id(): string 23 | { 24 | return $this->id; 25 | } 26 | 27 | public function name(): string 28 | { 29 | return $this->name; 30 | } 31 | 32 | public function alias(): string 33 | { 34 | return $this->alias; 35 | } 36 | 37 | public function packagesCount(): int 38 | { 39 | return $this->packagesCount; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Query/Admin/Model/User.php: -------------------------------------------------------------------------------- 1 | id = $id; 24 | $this->email = $email; 25 | $this->status = $status; 26 | $this->roles = $roles; 27 | } 28 | 29 | public function id(): string 30 | { 31 | return $this->id; 32 | } 33 | 34 | public function email(): string 35 | { 36 | return $this->email; 37 | } 38 | 39 | public function status(): string 40 | { 41 | return $this->status; 42 | } 43 | 44 | /** 45 | * @return string[] 46 | */ 47 | public function roles(): array 48 | { 49 | return $this->roles; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Query/Admin/OrganizationQuery.php: -------------------------------------------------------------------------------- 1 | downloads = $downloads; 15 | $this->lastDownload = $lastDownload; 16 | } 17 | 18 | public function downloads(): int 19 | { 20 | return $this->downloads; 21 | } 22 | 23 | public function lastDownload(): \DateTimeImmutable 24 | { 25 | return $this->lastDownload; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Query/Admin/TelemetryQuery.php: -------------------------------------------------------------------------------- 1 | 20 | */ 21 | public function getByEmail(string $email): Option; 22 | 23 | /** 24 | * @return Option 25 | */ 26 | public function getById(string $id): Option; 27 | 28 | public function count(): int; 29 | } 30 | -------------------------------------------------------------------------------- /src/Query/Api/Model/Error.php: -------------------------------------------------------------------------------- 1 | field = $field; 16 | $this->message = $message; 17 | } 18 | 19 | public function getField(): string 20 | { 21 | return $this->field; 22 | } 23 | 24 | public function getMessage(): string 25 | { 26 | return $this->message; 27 | } 28 | 29 | /** 30 | * @return array 31 | */ 32 | public function jsonSerialize(): array 33 | { 34 | return [ 35 | 'field' => $this->getField(), 36 | 'message' => $this->getMessage(), 37 | ]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Query/Api/Model/Errors.php: -------------------------------------------------------------------------------- 1 | errors = $errors; 20 | } 21 | 22 | /** 23 | * @return Error[] 24 | */ 25 | public function getErrors(): array 26 | { 27 | return $this->errors; 28 | } 29 | 30 | /** 31 | * @return array 32 | */ 33 | public function jsonSerialize(): array 34 | { 35 | return [ 36 | 'errors' => $this->getErrors(), 37 | ]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Query/Api/Model/Organizations.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | public function getById(string $id): Option; 17 | 18 | /** 19 | * @return Organization[] 20 | */ 21 | public function getUserOrganizations(string $userId, int $limit = 20, int $offset = 0): array; 22 | 23 | public function userOrganizationsCount(string $userId): int; 24 | 25 | /** 26 | * @return Token[] 27 | */ 28 | public function findAllTokens(string $organizationId, int $limit = 20, int $offset = 0): array; 29 | 30 | public function tokenCount(string $organizationId): int; 31 | 32 | /** 33 | * @return Option 34 | */ 35 | public function findToken(string $organizationId, string $value): Option; 36 | 37 | /** 38 | * @return Option 39 | */ 40 | public function findTokenByName(string $organizationId, string $name): Option; 41 | } 42 | -------------------------------------------------------------------------------- /src/Query/Api/PackageQuery.php: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | public function getById(string $organizationId, string $id): Option; 23 | } 24 | -------------------------------------------------------------------------------- /src/Query/User/Model/ApiToken.php: -------------------------------------------------------------------------------- 1 | name = $name; 17 | $this->value = $value; 18 | $this->createdAt = $createdAt; 19 | $this->lastUsedAt = $lastUsedAt; 20 | } 21 | 22 | public function name(): string 23 | { 24 | return $this->name; 25 | } 26 | 27 | public function value(): string 28 | { 29 | return $this->value; 30 | } 31 | 32 | public function createdAt(): \DateTimeImmutable 33 | { 34 | return $this->createdAt; 35 | } 36 | 37 | public function lastUsedAt(): ?\DateTimeImmutable 38 | { 39 | return $this->lastUsedAt; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Query/User/Model/Installs/Day.php: -------------------------------------------------------------------------------- 1 | date = $date; 15 | $this->installs = $installs; 16 | } 17 | 18 | public function date(): string 19 | { 20 | return $this->date; 21 | } 22 | 23 | public function installs(): int 24 | { 25 | return $this->installs; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Query/User/Model/OAuthToken.php: -------------------------------------------------------------------------------- 1 | type = $type; 15 | $this->createdAt = $createdAt; 16 | } 17 | 18 | public function type(): string 19 | { 20 | return $this->type; 21 | } 22 | 23 | public function createdAt(): \DateTimeImmutable 24 | { 25 | return $this->createdAt; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Query/User/Model/Organization/Invitation.php: -------------------------------------------------------------------------------- 1 | email = $email; 16 | $this->role = $role; 17 | $this->token = $token; 18 | } 19 | 20 | public function email(): string 21 | { 22 | return $this->email; 23 | } 24 | 25 | public function role(): string 26 | { 27 | return $this->role; 28 | } 29 | 30 | public function token(): string 31 | { 32 | return $this->token; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Query/User/Model/Organization/Member.php: -------------------------------------------------------------------------------- 1 | userId = $userId; 16 | $this->email = $email; 17 | $this->role = $role; 18 | } 19 | 20 | public function userId(): string 21 | { 22 | return $this->userId; 23 | } 24 | 25 | public function email(): string 26 | { 27 | return $this->email; 28 | } 29 | 30 | public function role(): string 31 | { 32 | return $this->role; 33 | } 34 | 35 | public function isOwner(): bool 36 | { 37 | return $this->role === 'owner'; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Query/User/Model/Organization/Token.php: -------------------------------------------------------------------------------- 1 | name = $name; 17 | $this->value = $value; 18 | $this->createdAt = $createdAt; 19 | $this->lastUsedAt = $lastUsedAt; 20 | } 21 | 22 | public function name(): string 23 | { 24 | return $this->name; 25 | } 26 | 27 | public function value(): string 28 | { 29 | return $this->value; 30 | } 31 | 32 | public function createdAt(): \DateTimeImmutable 33 | { 34 | return $this->createdAt; 35 | } 36 | 37 | public function lastUsedAt(): ?\DateTimeImmutable 38 | { 39 | return $this->lastUsedAt; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Query/User/Model/Package/Link.php: -------------------------------------------------------------------------------- 1 | type = $type; 17 | $this->target = $target; 18 | $this->constraint = $constraint; 19 | $this->targetPackageId = $targetPackageId; 20 | } 21 | 22 | public function type(): string 23 | { 24 | return $this->type; 25 | } 26 | 27 | public function target(): string 28 | { 29 | return $this->target; 30 | } 31 | 32 | public function constraint(): string 33 | { 34 | return $this->constraint; 35 | } 36 | 37 | public function targetPackageId(): ?string 38 | { 39 | return $this->targetPackageId; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Query/User/Model/PackageName.php: -------------------------------------------------------------------------------- 1 | id = $id; 16 | $this->name = $name; 17 | $this->organization = $organization; 18 | } 19 | 20 | public function id(): string 21 | { 22 | return $this->id; 23 | } 24 | 25 | public function name(): string 26 | { 27 | return $this->name; 28 | } 29 | 30 | public function organization(): string 31 | { 32 | return $this->organization; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Query/User/Model/Version.php: -------------------------------------------------------------------------------- 1 | version = $version; 17 | $this->reference = $reference; 18 | $this->size = $size; 19 | $this->date = $date; 20 | } 21 | 22 | public function version(): string 23 | { 24 | return $this->version; 25 | } 26 | 27 | public function reference(): string 28 | { 29 | return $this->reference; 30 | } 31 | 32 | public function size(): int 33 | { 34 | return $this->size; 35 | } 36 | 37 | public function date(): \DateTimeImmutable 38 | { 39 | return $this->date; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Query/User/Model/WebhookRequest.php: -------------------------------------------------------------------------------- 1 | date = $date; 16 | $this->ip = $ip; 17 | $this->userAgent = $userAgent; 18 | } 19 | 20 | public function date(): string 21 | { 22 | return $this->date; 23 | } 24 | 25 | public function ip(): ?string 26 | { 27 | return $this->ip; 28 | } 29 | 30 | public function userAgent(): ?string 31 | { 32 | return $this->userAgent; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Query/User/UserQuery.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | class ConfigRepository extends ServiceEntityRepository 19 | { 20 | public function __construct(ManagerRegistry $registry) 21 | { 22 | parent::__construct($registry, Config::class); 23 | } 24 | 25 | /** 26 | * @param array $values 27 | */ 28 | public function change(array $values): void 29 | { 30 | foreach ($values as $key => $value) { 31 | $config = $this->findOneBy(['key' => $key]); 32 | 33 | if ($config instanceof Config) { 34 | $config->setValue((string) $value); 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Repository/ScanResultRepository.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | class ScanResultRepository extends ServiceEntityRepository 19 | { 20 | public function __construct(ManagerRegistry $registry) 21 | { 22 | parent::__construct($registry, ScanResult::class); 23 | } 24 | 25 | public function add(ScanResult $result): void 26 | { 27 | $this->_em->persist($result); 28 | $this->_em->flush(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Security/Model/User/Organization.php: -------------------------------------------------------------------------------- 1 | alias = $alias; 17 | $this->name = $name; 18 | $this->role = $role; 19 | $this->hasAnonymousAccess = $hasAnonymousAccess; 20 | } 21 | 22 | public function alias(): string 23 | { 24 | return $this->alias; 25 | } 26 | 27 | public function name(): string 28 | { 29 | return $this->name; 30 | } 31 | 32 | public function role(): string 33 | { 34 | return $this->role; 35 | } 36 | 37 | public function hasAnonymousAccess(): bool 38 | { 39 | return $this->hasAnonymousAccess; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Security/UserChecker.php: -------------------------------------------------------------------------------- 1 | isDisabled()) { 25 | throw new CustomUserMessageAuthenticationException('Account is disabled.'); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Service/Doctrine/FixPostgreSQLDefaultSchemaListener.php: -------------------------------------------------------------------------------- 1 | getEntityManager() 19 | ->getConnection() 20 | ->createSchemaManager(); 21 | if (!$schemaManager instanceof PostgreSQLSchemaManager) { 22 | return; 23 | } 24 | foreach ($schemaManager->getExistingSchemaSearchPaths() as $namespace) { 25 | if (!$args->getSchema()->hasNamespace($namespace)) { 26 | $args->getSchema()->createNamespace($namespace); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Service/Downloader.php: -------------------------------------------------------------------------------- 1 | 17 | */ 18 | public function getContents(string $url, array $headers = [], callable $notFoundHandler = null): Option; 19 | 20 | /** 21 | * @param string[] $headers 22 | * @param callable(resource):void $onFulfilled 23 | */ 24 | public function getAsyncContents(string $url, array $headers, callable $onFulfilled): void; 25 | 26 | /** 27 | * @param callable(int):void $onFulfilled 28 | */ 29 | public function getLastModified(string $url, callable $onFulfilled): void; 30 | 31 | public function run(): void; 32 | } 33 | -------------------------------------------------------------------------------- /src/Service/Integration/BitbucketApi.php: -------------------------------------------------------------------------------- 1 | |Repository[] 11 | */ 12 | private array $repos = []; 13 | 14 | /** 15 | * @param Repository[] $repos 16 | */ 17 | public function __construct(array $repos) 18 | { 19 | foreach ($repos as $repo) { 20 | $this->repos[$repo->uuid()] = $repo; 21 | } 22 | } 23 | 24 | /** 25 | * @return array 26 | */ 27 | public function names(): array 28 | { 29 | $names = []; 30 | foreach ($this->repos as $repo) { 31 | $names[$repo->uuid()] = $repo->name(); 32 | } 33 | 34 | return $names; 35 | } 36 | 37 | public function get(string $uuid): Repository 38 | { 39 | if (!isset($this->repos[$uuid])) { 40 | throw new \RuntimeException(sprintf('Repository %s not found', $uuid)); 41 | } 42 | 43 | return $this->repos[$uuid]; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Service/Integration/BitbucketApi/Repository.php: -------------------------------------------------------------------------------- 1 | uuid = $uuid; 16 | $this->name = $name; 17 | $this->url = $url; 18 | } 19 | 20 | public function uuid(): string 21 | { 22 | return $this->uuid; 23 | } 24 | 25 | public function name(): string 26 | { 27 | return $this->name; 28 | } 29 | 30 | public function url(): string 31 | { 32 | return $this->url; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Service/Integration/BuddyApi.php: -------------------------------------------------------------------------------- 1 | client = $client; 17 | } 18 | 19 | public function primaryEmail(string $accessToken): string 20 | { 21 | $body = $this->client->getApiEmails()->getAuthenticatedUserEmails($accessToken)->getBody(); 22 | foreach ($body['emails'] as $email) { 23 | if ($email['confirmed'] === true) { 24 | return $email['email']; 25 | } 26 | } 27 | 28 | throw new BuddyApiException('Missing confirmed e-mail'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Service/Integration/GitHubApi.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function repositories(string $accessToken): array; 15 | 16 | public function addHook(string $accessToken, string $repo, string $url): void; 17 | 18 | public function removeHook(string $accessToken, string $repo, string $url): void; 19 | } 20 | -------------------------------------------------------------------------------- /src/Service/Integration/GitLabApi.php: -------------------------------------------------------------------------------- 1 | id = $id; 16 | $this->name = $name; 17 | $this->url = $url; 18 | } 19 | 20 | public function id(): int 21 | { 22 | return $this->id; 23 | } 24 | 25 | public function url(): string 26 | { 27 | return $this->url; 28 | } 29 | 30 | public function name(): string 31 | { 32 | return $this->name; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Service/Integration/GitLabApi/Projects.php: -------------------------------------------------------------------------------- 1 | |Project[] 11 | */ 12 | private array $projects = []; 13 | 14 | /** 15 | * @param Project[] $projects 16 | */ 17 | public function __construct(array $projects) 18 | { 19 | foreach ($projects as $project) { 20 | $this->projects[$project->id()] = $project; 21 | } 22 | } 23 | 24 | /** 25 | * @return array 26 | */ 27 | public function names(): array 28 | { 29 | $names = []; 30 | foreach ($this->projects as $project) { 31 | $names[$project->id()] = $project->name(); 32 | } 33 | 34 | return $names; 35 | } 36 | 37 | public function get(int $id): Project 38 | { 39 | if (!isset($this->projects[$id])) { 40 | throw new \RuntimeException(sprintf('Project %s not found', $id)); 41 | } 42 | 43 | return $this->projects[$id]; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Service/IntegrationRegister.php: -------------------------------------------------------------------------------- 1 | gitHubApi = $gitHubApi; 20 | $this->gitLabApi = $gitLabApi; 21 | $this->bitbucketApi = $bitbucketApi; 22 | } 23 | 24 | public function gitHubApi(): GitHubApi 25 | { 26 | return $this->gitHubApi; 27 | } 28 | 29 | public function gitLabApi(): GitLabApi 30 | { 31 | return $this->gitLabApi; 32 | } 33 | 34 | public function bitbucketApi(): BitbucketApi 35 | { 36 | return $this->bitbucketApi; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Service/Json.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | public static function decode(string $json): array 13 | { 14 | $data = json_decode($json, true); 15 | if (json_last_error() !== JSON_ERROR_NONE || !is_array($data)) { 16 | $data = []; 17 | } 18 | 19 | return $data; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Service/Mailer.php: -------------------------------------------------------------------------------- 1 | connection = $connection; 16 | } 17 | 18 | public function add(string $packageId, \DateTimeImmutable $date, ?string $ip, ?string $userAgent): void 19 | { 20 | $this->connection->insert('organization_package_webhook_request', [ 21 | 'package_id' => $packageId, 22 | 'date' => $date->format('Y-m-d H:i:s'), 23 | 'ip' => $ip, 24 | 'user_agent' => $userAgent, 25 | ]); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Service/PackageNormalizer.php: -------------------------------------------------------------------------------- 1 | dumper = new ArrayDumper(); 17 | } 18 | 19 | /** 20 | * @return mixed[] 21 | */ 22 | public function normalize(PackageInterface $package): array 23 | { 24 | $data = $this->dumper->dump($package); 25 | $data['uid'] = hash('crc32b', sprintf('%s:%s', $package->getPrettyName(), $package->getPrettyVersion())); 26 | 27 | return $data; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Service/PackageSynchronizer.php: -------------------------------------------------------------------------------- 1 | stream = $stream; 22 | $this->fileSize = $fileSize; 23 | } 24 | 25 | /** 26 | * @return resource 27 | */ 28 | public function stream() 29 | { 30 | return $this->stream; 31 | } 32 | 33 | public function fileSize(): int 34 | { 35 | return $this->fileSize; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Service/Proxy/Downloads.php: -------------------------------------------------------------------------------- 1 | connection = $connection; 17 | } 18 | 19 | /** 20 | * @param Package[] $packages 21 | */ 22 | public function save(array $packages, \DateTimeImmutable $date, ?string $ip, ?string $userAgent): void 23 | { 24 | foreach ($packages as $package) { 25 | $this->connection->insert('proxy_package_download', [ 26 | 'package' => $package->name(), 27 | 'version' => $package->version(), 28 | 'date' => $date->format('Y-m-d H:i:s'), 29 | 'ip' => $ip, 30 | 'user_agent' => $userAgent, 31 | ]); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Service/Proxy/Downloads/Package.php: -------------------------------------------------------------------------------- 1 | name = $name; 15 | $this->version = $version; 16 | } 17 | 18 | public function name(): string 19 | { 20 | return $this->name; 21 | } 22 | 23 | public function version(): string 24 | { 25 | return $this->version; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Service/Proxy/ProxyFactory.php: -------------------------------------------------------------------------------- 1 | downloader = $downloader; 19 | $this->filesystem = $proxyFilesystem; 20 | } 21 | 22 | public function create(string $url): Proxy 23 | { 24 | return new Proxy( 25 | (string) parse_url($url, PHP_URL_HOST), 26 | $url, 27 | $this->filesystem, 28 | $this->downloader 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Service/Security/PackageScanner.php: -------------------------------------------------------------------------------- 1 | title = $title; 23 | $this->cve = $cve; 24 | $this->link = $link; 25 | $this->branches = $branches; 26 | } 27 | 28 | /** 29 | * @return Versions[] 30 | */ 31 | public function branches(): array 32 | { 33 | return $this->branches; 34 | } 35 | 36 | /** 37 | * @return array 38 | */ 39 | public function toArray(): array 40 | { 41 | return [ 42 | 'title' => $this->title, 43 | 'cve' => $this->cve, 44 | 'link' => $this->link, 45 | ]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Service/Security/SecurityChecker/Package.php: -------------------------------------------------------------------------------- 1 | name = $name; 15 | $this->version = $version; 16 | } 17 | 18 | public function name(): string 19 | { 20 | return $this->name; 21 | } 22 | 23 | public function version(): string 24 | { 25 | return $this->version; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Service/Security/SecurityChecker/Result.php: -------------------------------------------------------------------------------- 1 | version = $version; 21 | $this->advisories = $advisories; 22 | } 23 | 24 | /** 25 | * @return array>> 26 | */ 27 | public function toArray(): array 28 | { 29 | return [ 30 | 'version' => $this->version, 31 | 'advisories' => array_map(fn ($advisory) => $advisory->toArray(), $this->advisories), 32 | ]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Service/Security/SecurityChecker/Versions.php: -------------------------------------------------------------------------------- 1 | from = $from; 17 | $this->to = $to; 18 | } 19 | 20 | public function include(string $version): bool 21 | { 22 | $isLarger = Semver::satisfies($version, $this->from); 23 | $isSmaller = $this->to === null ? true : Semver::satisfies($version, $this->to); 24 | 25 | return $isLarger && $isSmaller; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Service/Stream.php: -------------------------------------------------------------------------------- 1 | proxy = $proxy; 15 | $this->private = $private; 16 | } 17 | 18 | /** 19 | * @return array 20 | */ 21 | public function jsonSerialize(): array 22 | { 23 | return [ 24 | 'proxy' => $this->proxy, 25 | 'private' => $this->private, 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Service/Telemetry/Entry/Proxy.php: -------------------------------------------------------------------------------- 1 | packages = $packages; 14 | } 15 | 16 | /** 17 | * @return array 18 | */ 19 | public function jsonSerialize(): array 20 | { 21 | return [ 22 | 'packages' => $this->packages, 23 | ]; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Service/Telemetry/TechnicalEmail.php: -------------------------------------------------------------------------------- 1 | email = $email; 15 | $this->instanceId = $instanceId; 16 | } 17 | 18 | public function instanceId(): string 19 | { 20 | return $this->instanceId; 21 | } 22 | 23 | /** 24 | * @return array 25 | */ 26 | public function jsonSerialize(): array 27 | { 28 | return [ 29 | 'email' => $this->email, 30 | 'instanceId' => $this->instanceId, 31 | ]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Service/Twig/BytesExtension.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | private array $providers; 16 | 17 | /** 18 | * @param array $providers 19 | */ 20 | public function __construct(array $providers) 21 | { 22 | $this->providers = $providers; 23 | } 24 | 25 | /** 26 | * @return TwigFunction[] 27 | */ 28 | public function getFunctions(): array 29 | { 30 | return [ 31 | new TwigFunction('oauth_enabled', [$this, 'oAuthEnabled']), 32 | ]; 33 | } 34 | 35 | public function oAuthEnabled(?string $provider = null): bool 36 | { 37 | if ($provider !== null) { 38 | return isset($this->providers[$provider]) && strlen($this->providers[$provider]) > 0; 39 | } 40 | 41 | return count(array_filter($this->providers, fn ($id) => strlen((string) $id) > 0)) > 0; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Service/User/ResetPasswordTokenGenerator.php: -------------------------------------------------------------------------------- 1 | toString(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Service/User/UserOAuthTokenProvider.php: -------------------------------------------------------------------------------- 1 | repository = $repository; 20 | $this->em = $em; 21 | $this->tokenRefresher = $tokenRefresher; 22 | } 23 | 24 | public function findAccessToken(string $userId, string $type): ?string 25 | { 26 | $token = $this->repository->getById(Uuid::fromString($userId))->oauthToken($type); 27 | if ($token === null) { 28 | return null; 29 | } 30 | 31 | $accessToken = $token->accessToken($this->tokenRefresher); 32 | $this->em->flush(); 33 | 34 | return $accessToken; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Service/User/UserOAuthTokenRefresher.php: -------------------------------------------------------------------------------- 1 | oauth = $oauth; 18 | } 19 | 20 | public function refresh(string $type, string $refreshToken): AccessToken 21 | { 22 | $accessToken = $this->oauth->getClient($type)->getOAuth2Provider() 23 | ->getAccessToken(new RefreshToken(), ['refresh_token' => $refreshToken]); 24 | 25 | return new AccessToken( 26 | $accessToken->getToken(), 27 | $accessToken->getExpires() !== null ? (new \DateTimeImmutable())->setTimestamp($accessToken->getExpires()) : null 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Service/User/UserOAuthTokenRefresher/AccessToken.php: -------------------------------------------------------------------------------- 1 | token = $token; 16 | $this->expiresAt = $expiresAt; 17 | } 18 | 19 | public function token(): string 20 | { 21 | return $this->token; 22 | } 23 | 24 | public function expiresAt(): ?\DateTimeImmutable 25 | { 26 | return $this->expiresAt; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Validator/AliasNotBlank.php: -------------------------------------------------------------------------------- 1 | aliasGenerator = $aliasGenerator; 18 | } 19 | 20 | /** 21 | * @param mixed $value 22 | * @param Constraint|AliasNotBlank $constraint 23 | */ 24 | public function validate($value, Constraint $constraint): void 25 | { 26 | if (null === $value || '' === $value || !$constraint instanceof AliasNotBlank) { 27 | return; 28 | } 29 | 30 | if ($this->aliasGenerator->generate($value) === '') { 31 | $this->context->buildViolation($constraint->message) 32 | ->addViolation(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Validator/NotOrganizationMember.php: -------------------------------------------------------------------------------- 1 | usersQuery = $usersQuery; 18 | } 19 | 20 | /** 21 | * @param mixed $value 22 | * @param Constraint|UniqueEmail $constraint 23 | */ 24 | public function validate($value, Constraint $constraint): void 25 | { 26 | if (null === $value || '' === $value || !$constraint instanceof UniqueEmail) { 27 | return; 28 | } 29 | 30 | $value = \mb_strtolower($value); 31 | 32 | if (!$this->usersQuery->getByEmail($value)->isEmpty()) { 33 | $this->context->buildViolation($constraint->message) 34 | ->setParameter('{{ value }}', $value) 35 | ->addViolation(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Validator/UniqueOrganization.php: -------------------------------------------------------------------------------- 1 | 7 |
8 | {{ form(form) }} 9 |
10 | 11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /templates/admin/proxy/stats.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'organization/stats.html.twig' %} 2 | 3 | {% block header %}Repman proxy packages installs (last {{ days }} days){% endblock %} 4 | -------------------------------------------------------------------------------- /templates/admin/stats.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'organization/stats.html.twig' %} 2 | 3 | {% block header %}Repman private packages installs (last {{ days }} days){% endblock %} 4 | -------------------------------------------------------------------------------- /templates/admin/user/changeRoles.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block header %}Change {{ user.email }} roles{% endblock %} 4 | 5 | {% block content %} 6 |
7 |
8 | {{ form(form) }} 9 |
10 |
11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /templates/base-card.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block title %}Log in! - Repman{% endblock %} 4 | 5 | {% block body %} 6 | 7 |
8 |
9 |
10 |
11 | 19 |
20 |
21 |
22 |
23 | 24 | {% endblock %} 25 | -------------------------------------------------------------------------------- /templates/bundles/TwigBundle/Exception/error.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "base.html.twig" %} 2 | 3 | {% block body %} 4 | 5 |
6 |
7 |
8 |
{{ status_code }}
9 |
10 |

{% block status_text %}Oops… You just found an error page{% endblock %}

11 |

12 | {% block status_description %}{% endblock %} 13 |

14 | {% block button %} 15 | 20 | {% endblock %} 21 |
22 |
23 | 24 | {% endblock %} 25 | -------------------------------------------------------------------------------- /templates/bundles/TwigBundle/Exception/error401.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "bundles/TwigBundle/Exception/error.html.twig" %} 2 | 3 | {% block status_description %}We are sorry but you are not authorized to access this page{% endblock %} 4 | -------------------------------------------------------------------------------- /templates/bundles/TwigBundle/Exception/error403.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "bundles/TwigBundle/Exception/error.html.twig" %} 2 | 3 | {% block status_text %}Oops… Access Denied{% endblock %} 4 | 5 | {% block status_description %}We are sorry but you do not have permission to access this page{% endblock %} 6 | 7 | {% block button %} 8 | 13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /templates/bundles/TwigBundle/Exception/error404.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "bundles/TwigBundle/Exception/error.html.twig" %} 2 | 3 | {% block status_description %}We are sorry but the page you are looking for was not found{% endblock %} 4 | -------------------------------------------------------------------------------- /templates/bundles/TwigBundle/Exception/error500.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "bundles/TwigBundle/Exception/error.html.twig" %} 2 | 3 | {% block status_description %}We are sorry but our server encountered an internal error{% endblock %} 4 | -------------------------------------------------------------------------------- /templates/bundles/TwigBundle/Exception/error503.html.twig: -------------------------------------------------------------------------------- 1 | {% extends "bundles/TwigBundle/Exception/error.html.twig" %} 2 | 3 | {% block status_description %}We are sorry but our service is currently not available{% endblock %} 4 | -------------------------------------------------------------------------------- /templates/component/confirmationModal.html.twig: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /templates/component/docsLink.html.twig: -------------------------------------------------------------------------------- 1 | {% if text is defined %} 2 | {{ text }} 3 | {% else %} 4 | 5 | 6 | ? 7 | 8 | 9 | {% endif %} 10 | -------------------------------------------------------------------------------- /templates/component/flash.html.twig: -------------------------------------------------------------------------------- 1 | {% for label, messages in app.flashes %} 2 | {% for message in messages %} 3 |
4 | {{ message }} 5 |
6 | {% endfor %} 7 | {% endfor %} 8 | -------------------------------------------------------------------------------- /templates/component/js/addPackage.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | $('.addPackageType').on('change', function(e) { 3 | const type = e.target.value; 4 | const baseUrl = $('.addPackageFormUrl').val(); 5 | 6 | window.location.href = `${baseUrl}/${type}`; 7 | }); 8 | })(); 9 | -------------------------------------------------------------------------------- /templates/component/js/ga.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; 3 | ga('create', '{{ ga_tracking }}', 'auto'); 4 | 5 | if (isOAuthReferrer(document.referrer)) { 6 | ga('set', 'referrer', '{{ url("index") }}'); 7 | } 8 | 9 | ga('send', 'pageview'); 10 | 11 | function isOAuthReferrer(referrer) { 12 | return referrer.indexOf('https://bitbucket.org/site/oauth2') === 0 13 | || [ 14 | 'https://github.com/', 15 | 'https://gitlab.com/', 16 | 'https://app.buddy.works/' 17 | ].includes(referrer); 18 | } 19 | })(); 20 | -------------------------------------------------------------------------------- /templates/component/js/ga4.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | window.dataLayer = window.dataLayer || []; 3 | function gtag(){dataLayer.push(arguments);} 4 | gtag('js', new Date()); 5 | 6 | gtag('config', '{{ ga4_tracking }}'); 7 | })(); 8 | -------------------------------------------------------------------------------- /templates/component/pagination.html.twig: -------------------------------------------------------------------------------- 1 | {% set limit = filter.limit %} 2 | {% set currentOffset = filter.offset %} 3 | 4 | {% if count > 0 and currentOffset <= count %} 5 |
6 |

Showing {{ currentOffset + 1 }} to {{ min(currentOffset + limit, count) }} of {{ count }} entries

7 | {% if count > limit %} 8 |
    9 | {% for i in 0..(count/limit) %} 10 |
  • 11 | {{ i+1 }} 12 |
  • 13 | {% endfor %} 14 |
15 | {% endif %} 16 |
17 | {% endif %} 18 | -------------------------------------------------------------------------------- /templates/component/signUpLink.html.twig: -------------------------------------------------------------------------------- 1 | {% if config.userRegistrationEnabled %} 2 |
3 | Don't have account yet? Sign up 4 |
5 | {% endif %} 6 | -------------------------------------------------------------------------------- /templates/component/sort.html.twig: -------------------------------------------------------------------------------- 1 | {% if filter.getSortColumn() == column %} 2 | {% if filter.getSortOrder() == 'asc' %} 3 | {% set newSortOrder = 'desc' %} 4 | {% set sortTitle = 'Descending' %} 5 | {% else %} 6 | {% set newSortOrder = 'asc' %} 7 | {% set sortTitle = 'Ascending' %} 8 | {% endif %} 9 | 11 | {% if filter.getSortOrder() == 'asc' %} 12 | {% include 'svg/sort-asc.svg' %} 13 | {% else %} 14 | {% include 'svg/sort-desc.svg' %} 15 | {% endif %} 16 | 17 | {% else %} 18 | 20 | {% include 'svg/sort-asc.svg' %} 21 | 22 | {% endif %} 23 | -------------------------------------------------------------------------------- /templates/component/telemetryPrompt.html.twig: -------------------------------------------------------------------------------- 1 |
2 |

Telemetry

3 |

4 | Help us improve Repman by enabling sending anonymous usage statistic 5 | (more info). 6 |

7 |
8 |
9 | 10 | 11 |
12 |
13 | 14 | 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /templates/organization/addPackageFromVcs.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block header %}Add new package{% endblock %} 4 | 5 | {% block content %} 6 |

Import from {{ type }}

7 |
8 |
9 | {{ form(form) }} 10 |
11 |
12 | 13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /templates/organization/create.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block header %}Create a new organization{% endblock %} 4 | 5 | {% block content %} 6 |
7 |
8 | {{ form(form) }} 9 |
10 |
11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /templates/organization/generateToken.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block header %}Generate a new token{% endblock %} 4 | 5 | {% block content %} 6 |
7 |
8 | {{ form(form) }} 9 |
10 |
11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /templates/organization/member/changeRole.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block header %}Change the role of {{ member.email }}{% endblock %} 4 | 5 | {% block content %} 6 |
7 |
8 | {{ form(form) }} 9 |
10 |
11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /templates/organization/member/invite.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block header %}Invite a new member{% endblock %} 4 | 5 | {% block content %} 6 |
7 |
8 |

9 | See documentation for {% include 'component/docsLink.html.twig' with {'text': 'members and permissions', 'article': 'organization#members-and-permissions'} %}. 10 |

11 |
12 |
13 | 14 |
15 |
16 | {{ form(form) }} 17 |
18 |
19 | {% endblock %} 20 | -------------------------------------------------------------------------------- /templates/organization/package/edit.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block header %} 4 | 6 | « 7 | {% include 'svg/package.svg' %} 8 | 9 | 10 | {{ package.name }} edit 11 | {% endblock %} 12 | {% block header_btn %} 13 | {% include 'component/packageActions.html.twig' %} 14 | {% endblock %} 15 | 16 | {% block content %} 17 |
18 |
19 | {{ form(form) }} 20 |
21 |
22 | {% endblock %} 23 | -------------------------------------------------------------------------------- /templates/security/resetPassword.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base-card.html.twig' %} 2 | 3 | {% block title %}Reset password - Repman{% endblock %} 4 | 5 | {% block card %} 6 |
7 |
8 |
Change password
9 | 10 | {{ form(form) }} 11 |
12 |
13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /templates/security/sendResetPasswordLink.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base-card.html.twig' %} 2 | 3 | {% block title %}Reset password - Repman{% endblock %} 4 | 5 | {% block card %} 6 |
7 |
8 |
Reset your password
9 | 10 | {% include 'component/flash.html.twig' %} 11 | 12 |

Provide your email and we'll send you a password reset link.

13 | 14 | {{ form(form) }} 15 | 16 |
17 |
18 | {% include 'component/signUpLink.html.twig' %} 19 | {% endblock %} 20 | -------------------------------------------------------------------------------- /templates/svg/arrow-left.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/bar-chart.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/bitbucket-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/briefcase.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/check.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/clipboard.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/edit.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/github-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/gitlab-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/home.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/link.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/lock.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/log-out.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/package.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/plus-square.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/refresh.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/shield.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/sliders.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/sort-asc.svg: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /templates/svg/sort-desc.svg: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /templates/svg/trash.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/unlock.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/user.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/svg/users.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/user/generateApiToken.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block header %}Generate a new API token{% endblock %} 4 | 5 | {% block content %} 6 |
7 |
8 | {{ form_start(form) }} 9 | {{ form_errors(form) }} 10 | 13 | {{ form_widget(form.name) }} 14 | {{ form_end(form) }} 15 |
16 |
17 | {% endblock %} 18 | -------------------------------------------------------------------------------- /var/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/repman-io/repman/34e223a3de67e011a7619496c31eac33fb016e83/var/.gitkeep --------------------------------------------------------------------------------