Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
3e2c2c5
MC-30536: Enable 2FA for web API
nathanjosiah Mar 27, 2020
945fc63
Merge branch 'MC-22950' into MC-30536
nathanjosiah Mar 30, 2020
34ded5b
MC-30536: Enable 2FA for web API
nathanjosiah Mar 31, 2020
0942978
MC-30536: Enable 2FA for web API
nathanjosiah Apr 1, 2020
4bd9c55
MC-30536: Enable 2FA for web API
nathanjosiah Apr 2, 2020
b0f67d0
MC-30536: Enable 2FA for web API
nathanjosiah Apr 3, 2020
9b038a9
MC-30536: Enable 2FA for web API
nathanjosiah Apr 3, 2020
f4a5f05
MC-30536: Enable 2FA for web API
nathanjosiah Apr 6, 2020
042ca81
MC-30536: Enable 2FA for web API
nathanjosiah Apr 7, 2020
78b6852
MC-30536: Enable 2FA for web API
nathanjosiah Apr 7, 2020
afb27c7
MC-30536: Enable 2FA for web API
nathanjosiah Apr 7, 2020
c64c40c
MC-30536: Enable 2FA for web API
nathanjosiah Mar 27, 2020
0c43f6d
MC-30536: Enable 2FA for web API
nathanjosiah Apr 7, 2020
871e025
MC-30536: Enable 2FA for web API
nathanjosiah Apr 9, 2020
f6e45ff
MC-30536: Enable 2FA for web API
nathanjosiah Apr 10, 2020
987c5e3
MC-30536: Enable 2FA for web API
nathanjosiah Apr 10, 2020
e168a5e
MC-30536: Enable 2FA for web API
nathanjosiah Apr 10, 2020
205430c
MC-30536: Enable 2FA for web API
nathanjosiah Apr 13, 2020
32aaa42
MC-30536: Enable 2FA for web API
nathanjosiah Apr 13, 2020
dbfc031
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah Apr 15, 2020
8cc17ad
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah Apr 17, 2020
257bf9c
Merge branch '1.0-develop' of github.com:magento/security-package int…
nathanjosiah Apr 24, 2020
e675c2e
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah Apr 24, 2020
1f32fed
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah Apr 24, 2020
8371b1f
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah Apr 29, 2020
c2e37cb
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah Apr 30, 2020
ecc19ce
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah Apr 30, 2020
afce6ee
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah Apr 30, 2020
f7fe73a
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah Apr 30, 2020
ac67331
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah Apr 30, 2020
d2492b8
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah Apr 30, 2020
6766959
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 1, 2020
3bdc59c
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 1, 2020
8816c6c
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 1, 2020
7940c68
Merge branch '1.0-develop' of github.com:magento/security-package int…
nathanjosiah May 4, 2020
dc4669a
Merge branch 'MC-30536' into MC-30537
nathanjosiah May 4, 2020
fd7f443
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 4, 2020
a67c097
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 8, 2020
fa5fad6
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 8, 2020
3f82697
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 11, 2020
a036cc7
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 12, 2020
9633836
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 13, 2020
01b6164
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 13, 2020
a3dbb01
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 13, 2020
4b3406d
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 13, 2020
a165565
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 13, 2020
8aee787
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 13, 2020
48e46f7
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 14, 2020
5d0f9da
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 14, 2020
e3e3d9d
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 18, 2020
15233ae
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 18, 2020
f86acf7
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 24, 2020
9edd387
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 24, 2020
1b99d9b
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 24, 2020
adf1c60
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 24, 2020
a91106f
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 24, 2020
1c74ddf
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 25, 2020
409979f
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 25, 2020
8227385
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 25, 2020
48a2402
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 25, 2020
d7ec708
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 25, 2020
36622ce
MC-30537: Test automation with the new 2FA enabled by default
nathanjosiah May 25, 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
19 changes: 19 additions & 0 deletions TwoFactorAuth/Api/AdminTokenServiceInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\TwoFactorAuth\Api;

use Magento\Integration\Api\AdminTokenServiceInterface as OriginalTokenServiceInterface;

/**
* Obtain basic information about the user required to setup or use 2fa
*/
interface AdminTokenServiceInterface extends OriginalTokenServiceInterface
{

}
55 changes: 55 additions & 0 deletions TwoFactorAuth/Api/AuthyAuthenticateInterface.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;

/**
* Represents the authy provider authentication
*/
interface AuthyAuthenticateInterface
{
/**
* Get an admin token using authy 2fa
*
* @param string $username
* @param string $password
* @param string $otp
* @return string $otp
*/
public function createAdminAccessTokenWithCredentials(
string $username,
string $password,
string $otp
): string;

/**
* Send a one time password to a device using authy
*
* @param string $username
* @param string $password
* @param string $via
* @return void
*/
public function sendToken(
string $username,
string $password,
string $via
): void;

/**
* Authenticate using the present one touch response and get an admin token
*
* @param string $username
* @param string $password
* @return string
*/
public function creatAdminAccessTokenWithOneTouch(
string $username,
string $password
): string;
}
39 changes: 39 additions & 0 deletions TwoFactorAuth/Api/AuthyConfigureInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\TwoFactorAuth\Api;

use Magento\TwoFactorAuth\Api\Data\AuthyDeviceInterface;
use Magento\TwoFactorAuth\Api\Data\AuthyRegistrationPromptResponseInterface as ResponseInterface;

/**
* Represents the authy provider
*/
interface AuthyConfigureInterface
{
/**
* Get the information required to configure google
*
* @param string $tfaToken
* @param AuthyDeviceInterface $deviceData
* @return \Magento\TwoFactorAuth\Api\Data\AuthyRegistrationPromptResponseInterface
*/
public function sendDeviceRegistrationPrompt(
string $tfaToken,
AuthyDeviceInterface $deviceData
): ResponseInterface;

/**
* Activate the provider and get an admin token
*
* @param string $tfaToken
* @param string $otp
* @return void
*/
public function activate(string $tfaToken, string $otp): void;
}
6 changes: 6 additions & 0 deletions TwoFactorAuth/Api/CountryRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,46 @@

/**
* 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
*/
Expand Down
96 changes: 96 additions & 0 deletions TwoFactorAuth/Api/Data/AdminTokenResponseInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?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;

/**
* Represents the response to the new admin token response
*/
interface AdminTokenResponseInterface extends ExtensibleDataInterface
{
/**
* User id field
*/
const USER_ID = 'user_id';

/**
* Message field
*/
const MESSAGE = 'message';

/**
* Providers field
*/
const ACTIVE_PROVIDERS = 'active_providers';

/**
* Get the id of the authenticated user
*
* @return string
*/
public function getUserId(): string;

/**
* Set the id of the authenticated user
*
* @param int $value
* @return void
*/
public function setUserId(int $value): void;

/**
* Get the message from the response
*
* @return string
*/
public function getMessage(): string;

/**
* Set the id of the message
*
* @param string $value
* @return void
*/
public function setMessage(string $value): void;

/**
* Get the providers
*
* @return \Magento\TwoFactorAuth\Api\ProviderInterface[]
*/
public function getActiveProviders(): array;

/**
* Set the providers
*
* @param \Magento\TwoFactorAuth\Api\ProviderInterface[] $value
* @return void
*/
public function setActiveProviders(array $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\AdminTokenResponseExtensionInterface|null
*/
public function getExtensionAttributes(): ?AdminTokenResponseExtensionInterface;

/**
* Set an extension attributes object
*
* @param \Magento\TwoFactorAuth\Api\Data\AdminTokenResponseExtensionInterface $extensionAttributes
* @return void
*/
public function setExtensionAttributes(
AdminTokenResponseExtensionInterface $extensionAttributes
): void;
}
105 changes: 105 additions & 0 deletions TwoFactorAuth/Api/Data/AuthyDeviceInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?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;

/**
* Authy device data interface
*/
interface AuthyDeviceInterface extends ExtensibleDataInterface
{
/**
* Country field
*/
public const COUNTRY = 'country';

/**
* Phone number field
*/
public const PHONE = 'phone_number';

/**
* Method of authentication field
*/
public const METHOD = 'method';

/**
* Authenticate via sms
*/
public const METHOD_SMS = 'sms';

/**
* Authenticate via phone call
*/
public const METHOD_CALL = 'call';

/**
* Get the country
*
* @return string
*/
public function getCountry(): string;

/**
* Set the country
*
* @param string $value
* @return void
*/
public function setCountry(string $value): void;

/**
* Get the phone number
*
* @return string
*/
public function getPhoneNumber(): string;

/**
* Set the phone number
*
* @param string $value
* @return void
*/
public function setPhoneNumber(string $value): void;

/**
* Get the method to authenticate with
*
* @return string
*/
public function getMethod(): string;

/**
* Set the method to authenticate with
*
* @param string $value
* @return void
*/
public function setMethod(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\AuthyDeviceExtensionInterface|null
*/
public function getExtensionAttributes(): ?AuthyDeviceExtensionInterface;

/**
* Set an extension attributes object
*
* @param \Magento\TwoFactorAuth\Api\Data\AuthyDeviceExtensionInterface $extensionAttributes
* @return void
*/
public function setExtensionAttributes(
AuthyDeviceExtensionInterface $extensionAttributes
): void;
}
Loading