Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d5c472e
MC-22950: Enable 2FA by default for Admins
Feb 27, 2020
1c48716
MC-22950: Enable 2FA by default for Admins
Feb 27, 2020
36f015a
MC-22950: Enable 2FA by default for Admins
Feb 27, 2020
62c3d14
MC-22950: Enable 2FA by default for Admins
Feb 27, 2020
2bb036c
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 13, 2020
0c67a59
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 17, 2020
90d3a26
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 17, 2020
f7efbf3
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 17, 2020
db39665
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 17, 2020
6115a71
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 17, 2020
dfa97f6
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 18, 2020
82620c1
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 18, 2020
dc0f29c
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 18, 2020
70fac8c
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 18, 2020
b57be44
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 19, 2020
35a81d6
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 19, 2020
5c11f52
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 24, 2020
0900b6a
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 24, 2020
23ed204
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 24, 2020
ffaf7a9
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 25, 2020
19c76d2
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 25, 2020
28ba31b
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 26, 2020
096d1e7
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 30, 2020
64858b3
MC-22950: Enable 2FA by default for Admins
nathanjosiah Mar 30, 2020
87e7860
MC-22950: Enable 2FA by default for Admins
nathanjosiah Apr 6, 2020
6d0cade
Merge branch '1.0-develop' of github.com:magento/security-package int…
nathanjosiah Apr 17, 2020
63c292b
MC-22950: Enable 2FA by default for Admins
nathanjosiah Apr 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions TwoFactorAuth/Api/CountryRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\TwoFactorAuth\Api;

use Magento\Framework\Api\SearchCriteriaInterface;
use Magento\Framework\Api\SearchResultsInterface;
use Magento\TwoFactorAuth\Api\Data\CountryInterface;
use Magento\TwoFactorAuth\Api\Data\CountrySearchResultsInterface;

/**
* Countries repository
* @SuppressWarnings(PHPMD.ShortVariable)
*/
interface CountryRepositoryInterface
{
/**
* Save object
* @param CountryInterface $object
* @return CountryInterface
*/
public function save(CountryInterface $object): CountryInterface;

/**
* Get object by id
* @param int $id
* @return CountryInterface
*/
public function getById(int $id): CountryInterface;

/**
* Get by Code value
* @param string $value
* @return CountryInterface
*/
public function getByCode(string $value): CountryInterface;

/**
* Delete object
* @param CountryInterface $object
* @return void
*/
public function delete(CountryInterface $object): void;

/**
* Get a list of object
* @param SearchCriteriaInterface $searchCriteria
* @return CountrySearchResultsInterface
*/
public function getList(SearchCriteriaInterface $searchCriteria): SearchResultsInterface;
}
101 changes: 101 additions & 0 deletions TwoFactorAuth/Api/Data/CountryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\TwoFactorAuth\Api\Data;

use Magento\Framework\Api\ExtensibleDataInterface;

/**
* Country entity interface
*/
interface CountryInterface extends ExtensibleDataInterface
{
/**
* ID field name
*/
public const ID = 'country_id';

/**
* Code field name
*/
public const CODE = 'code';

/**
* Country name field name
*/
public const NAME = 'name';

/**
* Dial code field name
*/
public const DIAL_CODE = 'dial_code';

/**
* Get value for tfa_country_codes_id
* @return int
*/
public function getId(): int;

/**
* Set value for country_id
* @param int $value
*/
public function setId(int $value): void;

/**
* Get value for code
* @return string
*/
public function getCode(): string;

/**
* Set value for code
* @param string $value
*/
public function setCode(string $value): void;

/**
* Get value for name
* @return string
*/
public function getName(): string;

/**
* Set value for name
* @param string $value
*/
public function setName(string $value): void;

/**
* Get value for dial_code
* @return string
*/
public function getDialCode(): string;

/**
* Set value for dial_code
* @param string $value
*/
public function setDialCode(string $value): void;

/**
* Retrieve existing extension attributes object or create a new one
*
* Used fully qualified namespaces in annotations for proper work of extension interface/class code generation
*
* @return \Magento\TwoFactorAuth\Api\Data\CountryExtensionInterface|null
*/
public function getExtensionAttributes(): ?CountryExtensionInterface;

/**
* Set an extension attributes object
* @param \Magento\TwoFactorAuth\Api\Data\CountryExtensionInterface $extensionAttributes
*/
public function setExtensionAttributes(
CountryExtensionInterface $extensionAttributes
): void;
}
29 changes: 29 additions & 0 deletions TwoFactorAuth/Api/Data/CountrySearchResultsInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\TwoFactorAuth\Api\Data;

use Magento\Framework\Api\SearchResultsInterface;

/**
* Country search results interface
*/
interface CountrySearchResultsInterface extends SearchResultsInterface
{
/**
* Get an array of objects
* @return CountryInterface[]
*/
public function getItems(): array;

/**
* Set objects list
* @param CountryInterface[] $items
* @return CountrySearchResultsInterface
*/
public function setItems(array $items): CountrySearchResultsInterface;
}
99 changes: 99 additions & 0 deletions TwoFactorAuth/Api/Data/UserConfigInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\TwoFactorAuth\Api\Data;

use Magento\Framework\Api\ExtensibleDataInterface;

/**
* User configuration interface
*/
interface UserConfigInterface extends ExtensibleDataInterface
{
/**
* Entity ID field name
*/
public const ID = 'config_id';

/**
* User ID field name
*/
public const USER_ID = 'user_id';

/**
* Encoded providers filed name
*/
public const ENCODED_PROVIDERS = 'encoded_providers';

/**
* Selected default provider field name
*/
public const DEFAULT_PROVIDER = 'default_provider';

/**
* Get value for config_id
* @return int
*/
public function getId(): int;

/**
* Set value for config_id
* @param int $value
*/
public function setId(int $value): void;

/**
* Get value for user_id
* @return int
*/
public function getUserId(): int;

/**
* Set value for user_id
* @param int $value
*/
public function setUserId(int $value): void;

/**
* Get value for encoded_providers
* @return string
*/
public function getEncodedProviders(): string;

/**
* Set value for encoded_providers
* @param string $value
*/
public function setEncodedProviders(string $value): void;

/**
* Get value for default_provider
* @return string
*/
public function getDefaultProvider(): string;

/**
* Set value for default_provider
* @param string $value
*/
public function setDefaultProvider(string $value): void;

/**
* Retrieve existing extension attributes object or create a new one
*
* Used fully qualified namespaces in annotations for proper work of extension interface/class code generation
*
* @return \Magento\TwoFactorAuth\Api\Data\UserConfigExtensionInterface|null
*/
public function getExtensionAttributes(): ?UserConfigExtensionInterface;

/**
* Set an extension attributes object
* @param \Magento\TwoFactorAuth\Api\Data\UserConfigExtensionInterface $extensionAttributes
*/
public function setExtensionAttributes(UserConfigExtensionInterface $extensionAttributes): void;
}
29 changes: 29 additions & 0 deletions TwoFactorAuth/Api/Data/UserConfigSearchResultsInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\TwoFactorAuth\Api\Data;

use Magento\Framework\Api\SearchResultsInterface;

/**
* User config search result
*/
interface UserConfigSearchResultsInterface extends SearchResultsInterface
{
/**
* Get an array of objects
* @return UserConfigInterface[]
*/
public function getItems(): array;

/**
* Set objects list
* @param UserConfigInterface[] $items
* @return UserConfigSearchResultsInterface
*/
public function setItems(array $items): UserConfigSearchResultsInterface;
}
32 changes: 32 additions & 0 deletions TwoFactorAuth/Api/EngineInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\TwoFactorAuth\Api;

use Magento\Framework\DataObject;
use Magento\User\Api\Data\UserInterface;

/**
* 2FA engine interface
*/
interface EngineInterface
{
/**
* Return true if this provider has been enabled by admin
*
* @return bool
*/
public function isEnabled(): bool;

/**
* Return true on token validation
* @param UserInterface $user
* @param DataObject $request
* @return bool
*/
public function verify(UserInterface $user, DataObject $request): bool;
}
17 changes: 17 additions & 0 deletions TwoFactorAuth/Api/Exception/NotificationExceptionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\TwoFactorAuth\Api\Exception;

/**
* Occurs when failed to notify a user.
*/
interface NotificationExceptionInterface extends \Throwable
{

}
Loading