| @@ 24-108 (lines=85) @@ | ||
| 21 | use Surfnet\StepupMiddlewareClientBundle\Dto\Dto; |
|
| 22 | use Symfony\Component\Validator\Constraints as Assert; |
|
| 23 | ||
| 24 | class RaListing implements Dto |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * @Assert\NotBlank(message="middleware_client.dto.ra_listing.id.must_not_be_blank") |
|
| 28 | * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.id.must_be_string") |
|
| 29 | * |
|
| 30 | * @var string |
|
| 31 | */ |
|
| 32 | public $identityId; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @Assert\NotBlank(message="middleware_client.dto.ra_listing.institution.must_not_be_blank") |
|
| 36 | * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.institution.must_be_string") |
|
| 37 | * |
|
| 38 | * @var string |
|
| 39 | */ |
|
| 40 | public $institution; |
|
| 41 | ||
| 42 | /** |
|
| 43 | * @Assert\NotBlank(message="middleware_client.dto.ra_listing.institution.must_not_be_blank") |
|
| 44 | * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.institution.must_be_string") |
|
| 45 | * |
|
| 46 | * @var string |
|
| 47 | */ |
|
| 48 | public $raInstitution; |
|
| 49 | ||
| 50 | /** |
|
| 51 | * @Assert\NotBlank(message="middleware_client.dto.ra_listing.common_name.must_not_be_blank") |
|
| 52 | * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.common_name.must_be_string") |
|
| 53 | * |
|
| 54 | * @var string |
|
| 55 | */ |
|
| 56 | public $commonName; |
|
| 57 | ||
| 58 | /** |
|
| 59 | * @Assert\NotBlank(message="middleware_client.dto.ra_listing.email.must_not_be_blank") |
|
| 60 | * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.email.must_be_string") |
|
| 61 | * |
|
| 62 | * @var string |
|
| 63 | */ |
|
| 64 | public $email; |
|
| 65 | ||
| 66 | /** |
|
| 67 | * @Assert\NotBlank(message="middleware_client.dto.ra_listing.role.must_not_be_blank") |
|
| 68 | * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.role.must_be_string") |
|
| 69 | * |
|
| 70 | * @var string |
|
| 71 | */ |
|
| 72 | public $role; |
|
| 73 | ||
| 74 | /** |
|
| 75 | * @Assert\NotBlank(message="middleware_client.dto.ra_listing.location.must_not_be_blank") |
|
| 76 | * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.location.must_be_string") |
|
| 77 | * |
|
| 78 | * @var string |
|
| 79 | */ |
|
| 80 | public $location; |
|
| 81 | ||
| 82 | /** |
|
| 83 | * @Assert\NotBlank(message="middleware_client.dto.ra_listing.contact_information.must_not_be_blank") |
|
| 84 | * @Assert\Type(type="string", message="middleware_client.dto.ra_listing.contact_information.must_be_string") |
|
| 85 | * |
|
| 86 | * @var string |
|
| 87 | */ |
|
| 88 | public $contactInformation; |
|
| 89 | ||
| 90 | /** |
|
| 91 | * @param array $data |
|
| 92 | * @return static |
|
| 93 | */ |
|
| 94 | public static function fromData(array $data) |
|
| 95 | { |
|
| 96 | $raListing = new self(); |
|
| 97 | $raListing->identityId = $data['identity_id']; |
|
| 98 | $raListing->institution = $data['institution']; |
|
| 99 | $raListing->commonName = $data['common_name']; |
|
| 100 | $raListing->email = $data['email']; |
|
| 101 | $raListing->role = $data['role']; |
|
| 102 | $raListing->location = $data['location']; |
|
| 103 | $raListing->contactInformation = $data['contact_information']; |
|
| 104 | $raListing->raInstitution = $data['ra_institution']; |
|
| 105 | ||
| 106 | return $raListing; |
|
| 107 | } |
|
| 108 | } |
|
| 109 | ||
| @@ 25-116 (lines=92) @@ | ||
| 22 | use Surfnet\StepupMiddlewareClientBundle\Dto\Dto; |
|
| 23 | use Symfony\Component\Validator\Constraints as Assert; |
|
| 24 | ||
| 25 | class VerifiedSecondFactor implements Dto |
|
| 26 | { |
|
| 27 | /** |
|
| 28 | * @Assert\NotBlank(message="middleware_client.dto.verified_second_factor.id.must_not_be_blank") |
|
| 29 | * @Assert\Type(type="string", message="middleware_client.dto.verified_second_factor.id.must_be_string") |
|
| 30 | * @var string |
|
| 31 | */ |
|
| 32 | public $id; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @Assert\NotBlank(message="middleware_client.dto.verified_second_factor.type.must_not_be_blank") |
|
| 36 | * @Assert\Type(type="string", message="middleware_client.dto.verified_second_factor.type.must_be_string") |
|
| 37 | * @var string |
|
| 38 | */ |
|
| 39 | public $type; |
|
| 40 | ||
| 41 | /** |
|
| 42 | * @Assert\NotBlank( |
|
| 43 | * message="middleware_client.dto.verified_second_factor.second_factor_identifier.must_not_be_blank" |
|
| 44 | * ) |
|
| 45 | * @Assert\Type( |
|
| 46 | * type="string", |
|
| 47 | * message="middleware_client.dto.verified_second_factor.second_factor_identifier.must_be_string" |
|
| 48 | * ) |
|
| 49 | * @var string |
|
| 50 | */ |
|
| 51 | public $secondFactorIdentifier; |
|
| 52 | ||
| 53 | /** |
|
| 54 | * @Assert\NotBlank(message="middleware_client.dto.verified_second_factor.registration_code.must_not_be_blank") |
|
| 55 | * @Assert\Type( |
|
| 56 | * type="string", |
|
| 57 | * message="middleware_client.dto.verified_second_factor.registration_code.must_be_string" |
|
| 58 | * ) |
|
| 59 | * @var string |
|
| 60 | */ |
|
| 61 | public $registrationCode; |
|
| 62 | ||
| 63 | ||
| 64 | /** |
|
| 65 | * @var DateTime |
|
| 66 | */ |
|
| 67 | public $registrationRequestedAt; |
|
| 68 | ||
| 69 | /** |
|
| 70 | * @Assert\NotBlank(message="middleware_client.dto.verified_second_factor.identity_id.must_not_be_blank") |
|
| 71 | * @Assert\Type( |
|
| 72 | * type="string", |
|
| 73 | * message="middleware_client.dto.verified_second_factor.identity_id.must_be_string" |
|
| 74 | * ) |
|
| 75 | * @var string |
|
| 76 | */ |
|
| 77 | public $identityId; |
|
| 78 | ||
| 79 | /** |
|
| 80 | * @Assert\NotBlank(message="middleware_client.dto.verified_second_factor.institution.must_not_be_blank") |
|
| 81 | * @Assert\Type( |
|
| 82 | * type="string", |
|
| 83 | * message="middleware_client.dto.verified_second_factor.institution.must_be_string" |
|
| 84 | * ) |
|
| 85 | * @var string |
|
| 86 | */ |
|
| 87 | public $institution; |
|
| 88 | ||
| 89 | /** |
|
| 90 | * @Assert\NotBlank(message="middleware_client.dto.verified_second_factor.common_name.must_not_be_blank") |
|
| 91 | * @Assert\Type( |
|
| 92 | * type="string", |
|
| 93 | * message="middleware_client.dto.verified_second_factor.common_name.must_be_string" |
|
| 94 | * ) |
|
| 95 | * @var string |
|
| 96 | */ |
|
| 97 | public $commonName; |
|
| 98 | ||
| 99 | public static function fromData(array $data) |
|
| 100 | { |
|
| 101 | $secondFactor = new self(); |
|
| 102 | $secondFactor->id = $data['id']; |
|
| 103 | $secondFactor->type = $data['type']; |
|
| 104 | $secondFactor->secondFactorIdentifier = $data['second_factor_identifier']; |
|
| 105 | $secondFactor->registrationCode = $data['registration_code']; |
|
| 106 | $secondFactor->registrationRequestedAt = new DateTime( |
|
| 107 | $data['registration_requested_at'] |
|
| 108 | ); |
|
| 109 | ||
| 110 | $secondFactor->identityId = $data['identity_id']; |
|
| 111 | $secondFactor->institution = $data['institution']; |
|
| 112 | $secondFactor->commonName = $data['common_name']; |
|
| 113 | ||
| 114 | return $secondFactor; |
|
| 115 | } |
|
| 116 | } |
|
| 117 | ||
| @@ 24-92 (lines=69) @@ | ||
| 21 | use Surfnet\StepupMiddlewareClientBundle\Dto\Dto; |
|
| 22 | use Symfony\Component\Validator\Constraints as Assert; |
|
| 23 | ||
| 24 | class Profile implements Dto |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * @Assert\NotBlank(message="middleware_client.dto.identity.id.must_not_be_blank") |
|
| 28 | * @Assert\Type(type="string", message="middleware_client.dto.identity.id.must_be_string") |
|
| 29 | * @var string |
|
| 30 | */ |
|
| 31 | public $id; |
|
| 32 | ||
| 33 | /** |
|
| 34 | * @Assert\NotBlank(message="middleware_client.dto.identity.name_id.must_not_be_blank") |
|
| 35 | * @Assert\Type(type="string", message="middleware_client.dto.identity.name_id.must_be_string") |
|
| 36 | * @var string |
|
| 37 | */ |
|
| 38 | public $nameId; |
|
| 39 | ||
| 40 | /** |
|
| 41 | * @Assert\NotBlank(message="middleware_client.dto.identity.institution.must_not_be_blank") |
|
| 42 | * @Assert\Type(type="string", message="middleware_client.dto.identity.institution.must_be_string") |
|
| 43 | * @var string |
|
| 44 | */ |
|
| 45 | public $institution; |
|
| 46 | ||
| 47 | /** |
|
| 48 | * @Assert\NotBlank(message="middleware_client.dto.identity.email.must_not_be_blank") |
|
| 49 | * @Assert\Type(type="string", message="middleware_client.dto.identity.email.must_be_string") |
|
| 50 | * @var string |
|
| 51 | */ |
|
| 52 | public $email; |
|
| 53 | ||
| 54 | /** |
|
| 55 | * @Assert\NotBlank(message="middleware_client.dto.identity.common_name.must_not_be_blank") |
|
| 56 | * @Assert\Type(type="string", message="middleware_client.dto.identity.common_name.must_be_string") |
|
| 57 | * @var string |
|
| 58 | */ |
|
| 59 | public $commonName; |
|
| 60 | ||
| 61 | /** |
|
| 62 | * @Assert\NotBlank(message="middleware_client.dto.identity.preferred_locale.must_not_be_blank") |
|
| 63 | * @Assert\Type(type="string", message="middleware_client.dto.identity.preferred_locale.must_be_string") |
|
| 64 | * @var string |
|
| 65 | */ |
|
| 66 | public $preferredLocale; |
|
| 67 | ||
| 68 | /** |
|
| 69 | * @var bool |
|
| 70 | */ |
|
| 71 | public $isSraa; |
|
| 72 | ||
| 73 | /** |
|
| 74 | * @var array |
|
| 75 | */ |
|
| 76 | public $authorizations; |
|
| 77 | ||
| 78 | public static function fromData(array $data) |
|
| 79 | { |
|
| 80 | $identity = new self(); |
|
| 81 | $identity->id = $data['id']; |
|
| 82 | $identity->nameId = $data['name_id']; |
|
| 83 | $identity->institution = $data['institution']; |
|
| 84 | $identity->email = $data['email']; |
|
| 85 | $identity->commonName = $data['common_name']; |
|
| 86 | $identity->preferredLocale = $data['preferred_locale']; |
|
| 87 | $identity->authorizations = $data['authorizations']; |
|
| 88 | $identity->isSraa = $data['is_sraa']; |
|
| 89 | ||
| 90 | return $identity; |
|
| 91 | } |
|
| 92 | } |
|
| 93 | ||