Skip to content

Commit

Permalink
Fix tests and config
Browse files Browse the repository at this point in the history
  • Loading branch information
parijke committed Feb 12, 2024
1 parent b044832 commit 48ec423
Show file tree
Hide file tree
Showing 23 changed files with 187 additions and 286 deletions.
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"php": "^8.2",
"ext-dom": "*",
"ext-openssl": "*",
"doctrine/annotations": "^2.0",
"fortawesome/font-awesome": "~4.2.0",
"guzzlehttp/guzzle": "^7",
"incenteev/composer-parameter-handler": "~2.0",
Expand All @@ -29,6 +30,7 @@
"symfony/expression-language": "^6.0",
"symfony/flex": "^v2.4.3",
"symfony/form": "^6.0",
"symfony/framework-bundle": "6.4.*",
"symfony/http-foundation": "^6.0",
"symfony/monolog-bundle": "^3.5",
"symfony/security-bundle": "^6.0",
Expand Down
78 changes: 77 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@ framework:
translator: { fallback: "%default_locale%" }
secret: "%secret%"
form: ~
handle_all_throwables: true
annotations:
enabled: false
csrf_protection: ~
validation: { enable_annotations: true }
validation: { enable_attributes: true }
default_locale: "%default_locale%"
trusted_hosts: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: ~
name: sess_ra
cookie_samesite: lax
cookie_httponly: true
cookie_secure: true
fragments: false
http_method_override: true
error_controller: Surfnet\StepupRa\RaBundle\Controller\ExceptionController
php_errors:
log: true
5 changes: 3 additions & 2 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
security:
providers:
middleware:
id: ra.service.identity
saml-provider:
id: Surfnet\StepupRa\RaBundle\Security\Authentication\Provider\SamlProvider

firewalls:
dev:
Expand Down Expand Up @@ -32,4 +32,5 @@ security:

access_control:
- { path: ^/saml, roles: PUBLIC_ACCESS, requires_channel: https }
- { path: ^/authentication, roles: PUBLIC_ACCESS, requires_channel: https }
- { path: ^/, roles: ROLE_RA, requires_channel: https }
8 changes: 4 additions & 4 deletions config/routes/dev/jms_translation.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JMSTranslationBundle_ui:
resource: "@JMSTranslationBundle/Controller/"
type: annotation
prefix: /_trans
#JMSTranslationBundle_ui:
# resource: "@JMSTranslationBundle/Controller/"
# type: attribute
# prefix: /_trans
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,10 @@ class AccreditCandidateCommand

public string $institution;

/**
* @Assert\NotBlank(message="ra.accredit_candidate.location.may_not_be_blank")
*/
#[Assert\NotBlank(message: 'ra.accredit_candidate.location.may_not_be_blank')]
public string $location;

/**
* @Assert\NotBlank(message="ra.accredit_candidate.contact_information.may_not_be_blank")
*/
#[Assert\NotBlank(message: 'ra.accredit_candidate.contact_information.may_not_be_blank')]
public string $contactInformation;

public RoleAtInstitution $roleAtInstitution;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@ class AmendRegistrationAuthorityInformationCommand
{
public string $identityId;

/**
* @Assert\NotBlank(message="ra.amend_ra_information.location")
*/
#[Assert\NotBlank(message: 'ra.amend_ra_information.location')]
public string $location;

/**
* @Assert\NotBlank(message="ra.amend_ra_information.contact_information")
*/
#[Assert\NotBlank(message: 'ra.amend_ra_information.contact_information')]
public string $contactInformation;

public string $institution;
Expand Down
54 changes: 16 additions & 38 deletions src/Surfnet/StepupRa/RaBundle/Command/ChangeRaLocationCommand.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* Copyright 2016 SURFnet bv
*
Expand All @@ -22,42 +24,18 @@

class ChangeRaLocationCommand
{
/**
* @var string
*/
public $id;

/**
* @var string
*/
public $institution;

/**
* @var string
*/
public $currentUserId;

/**
* @Assert\NotBlank(message="ra.accredit_candidate.name.may_not_be_blank")
* @Assert\Type(type="string")
*
* @var string
*/
public $name;

/**
* @Assert\NotBlank(message="ra.accredit_candidate.location.may_not_be_blank")
* @Assert\Type(type="string")
*
* @var string
*/
public $location;

/**
* @Assert\NotBlank(message="ra.accredit_candidate.contact_information.may_not_be_blank")
* @Assert\Type(type="string")
*
* @var string
*/
public $contactInformation;
public string $id;

public string $institution;

public string $currentUserId;

#[Assert\NotBlank(message: 'ra.accredit_candidate.name.may_not_be_blank')]
public string $name;

#[Assert\NotBlank(message: 'ra.accredit_candidate.location.may_not_be_blank')]
public string $location;

#[Assert\NotBlank(message: 'ra.accredit_candidate.contact_information.may_not_be_blank')]
public string $contactInformation;
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,26 @@ class CreateRaLocationCommand
public $currentUserId;

/**
* @Assert\NotBlank(message="ra.accredit_candidate.name.may_not_be_blank")
* @Assert\Type(type="string")
*
* @var string
*/
#[Assert\NotBlank(message: 'ra.accredit_candidate.name.may_not_be_blank')]
#[Assert\Type(type: 'string')]
public $name;

/**
* @Assert\NotBlank(message="ra.accredit_candidate.location.may_not_be_blank")
* @Assert\Type(type="string")
*
* @var string
*/
#[Assert\NotBlank(message: 'ra.accredit_candidate.location.may_not_be_blank')]
#[Assert\Type(type: 'string')]
public $location;

/**
* @Assert\NotBlank(message="ra.accredit_candidate.contact_information.may_not_be_blank")
* @Assert\Type(type="string")
*
* @var string
*/
#[Assert\NotBlank(message: 'ra.accredit_candidate.contact_information.may_not_be_blank')]
#[Assert\Type(type: 'string')]
public $contactInformation;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ final class ExportRaSecondFactorsCommand
public const STATUS_REVOKED = 'revoked';

/**
* @Assert\NotBlank(message="ra.search_ra_second_factors.actor.blank")
* @Assert\Type("string", message="ra.search_ra_second_factors.actor.type")
*
* @var string
*/
#[Assert\NotBlank(message: 'ra.search_ra_second_factors.actor.blank')]
#[Assert\Type('string', message: 'ra.search_ra_second_factors.actor.type')]
public $actorId;

/**
Expand Down Expand Up @@ -61,30 +61,21 @@ final class ExportRaSecondFactorsCommand
public $institution;

/**
* @Assert\Choice(
* {"unverified", "verified", "vetted", "revoked"},
* message="ra.search_ra_second_factors.status.invalid_choice"
* )
*
* @var string|null One of the STATUS_* constants.
*/
#[Assert\Choice(['unverified', 'verified', 'vetted', 'revoked'], message: 'ra.search_ra_second_factors.status.invalid_choice')]
public $status;

/**
* @Assert\Choice(
* {"name", "type", "secondFactorId", "email", "status"},
* message="ra.search_ra_second_factors.order_by.invalid_choice"
* )
*
* @var string|null
*/
#[Assert\Choice(['name', 'type', 'secondFactorId', 'email', 'status'], message: 'ra.search_ra_second_factors.order_by.invalid_choice')]
public $orderBy;

/**
* @Assert\Choice({"asc", "desc"}, message="ra.search_ra_second_factors.order_direction.invalid_choice")
*
* @var string|null
*/
#[Assert\Choice(['asc', 'desc'], message: 'ra.search_ra_second_factors.order_direction.invalid_choice')]
public $orderDirection;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@

class SearchRaCandidatesCommand
{
/**
* @Assert\NotBlank(message="ra.search_ra_candidates.actor_id.blank")
*/
#[Assert\NotBlank(message: 'ra.search_ra_candidates.actor_id.blank')]
public string $actorId;

public ?string $institution = null;
Expand All @@ -35,22 +33,13 @@ class SearchRaCandidatesCommand

public ?string $raInstitution = null;

/**
* @Assert\Choice(
* {"name", "email"},
* message="ra.search_ra_candidates.order_by.invalid_choice"
* )
*/
#[Assert\Choice(['name', 'email'], message: 'ra.search_ra_candidates.order_by.invalid_choice')]
public ?string $orderBy = null;

/**
* @Assert\Choice({"asc", "desc"}, message="ra.search_ra_candidates.order_direction.invalid_choice")
*/
#[Assert\Choice(['asc', 'desc'], message: 'ra.search_ra_candidates.order_direction.invalid_choice')]
public ?string $orderDirection = null;

/**
* @Assert\GreaterThan(0, message="ra.search_ra_candidates.page_number.greater_than_zero")
*/
#[Assert\GreaterThan(0, message: 'ra.search_ra_candidates.page_number.greater_than_zero')]
public int $pageNumber;

public array $institutionFilterOptions;
Expand Down
Loading

0 comments on commit 48ec423

Please sign in to comment.