File tree Expand file tree Collapse file tree 6 files changed +13
-16
lines changed
dev/tests/api-functional/testsuite/Magento/Integration/Model Expand file tree Collapse file tree 6 files changed +13
-16
lines changed Original file line number Diff line number Diff line change 66
77declare (strict_types=1 );
88
9- namespace Magento \Webapi \Model \Authorization ;
9+ namespace Magento \Integration \Model \Config ;
1010
1111use Magento \Framework \App \Config \ScopeConfigInterface ;
1212use Magento \Store \Model \ScopeInterface ;
@@ -19,7 +19,7 @@ class AuthorizationConfig
1919 /**
2020 * XML Path for Enable Integration as Bearer
2121 */
22- const CONFIG_PATH_INTEGRATION_BEARER = 'webapi/authorization /enable_integration_as_bearer ' ;
22+ const CONFIG_PATH_INTEGRATION_BEARER = 'oauth/consumer /enable_integration_as_bearer ' ;
2323
2424 /**
2525 * @var ScopeConfigInterface
Original file line number Diff line number Diff line change 1313use Magento \Integration \Api \Exception \UserTokenException ;
1414use Magento \Integration \Api \IntegrationServiceInterface ;
1515use Magento \Integration \Api \UserTokenReaderInterface ;
16+ use Magento \Integration \Model \Config \AuthorizationConfig ;
1617use Magento \Integration \Model \CustomUserContext ;
1718use Magento \Integration \Model \Oauth \Token ;
1819use Magento \Integration \Model \Oauth \TokenFactory ;
1920use Magento \Integration \Helper \Oauth \Data as OauthHelper ;
20- use Magento \Webapi \Model \Authorization \AuthorizationConfig ;
2121
2222/**
2323 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -147,6 +147,6 @@ private function getUserId(Token $tokenModel): int
147147 throw new UserTokenException ('Invalid token found ' );
148148 }
149149
150- return $ userId ;
150+ return ( int ) $ userId ;
151151 }
152152}
Original file line number Diff line number Diff line change 66
77declare (strict_types=1 );
88
9- namespace Magento \Webapi \Test \Unit \Model \Authorization ;
9+ namespace Magento \Integration \Test \Unit \Model \ Config \Authorization ;
1010
1111use Magento \Framework \App \Config \ScopeConfigInterface ;
12- use Magento \Webapi \Model \Authorization \AuthorizationConfig ;
12+ use Magento \Integration \Model \Config \AuthorizationConfig ;
1313use PHPUnit \Framework \MockObject \MockObject ;
1414use PHPUnit \Framework \TestCase ;
1515
@@ -34,7 +34,7 @@ protected function setUp(): void
3434 public function testEnabled ()
3535 {
3636 $ this ->scopeConfig ->method ('isSetFlag ' )
37- ->with ('webapi/authorization /enable_integration_as_bearer ' )
37+ ->with ('oauth/consumer /enable_integration_as_bearer ' )
3838 ->willReturn (true );
3939
4040 self ::assertTrue ($ this ->config ->isIntegrationAsBearerEnabled ());
@@ -43,7 +43,7 @@ public function testEnabled()
4343 public function testDisabled ()
4444 {
4545 $ this ->scopeConfig ->method ('isSetFlag ' )
46- ->with ('webapi/authorization /enable_integration_as_bearer ' )
46+ ->with ('oauth/consumer /enable_integration_as_bearer ' )
4747 ->willReturn (false );
4848
4949 self ::assertFalse ($ this ->config ->isIntegrationAsBearerEnabled ());
Original file line number Diff line number Diff line change 5454 <comment >Timeout for OAuth consumer credentials Post request within X seconds.</comment >
5555 <validate >required-entry validate-zero-or-greater validate-number</validate >
5656 </field >
57+ <field id =" enable_integration_as_bearer" translate =" label" type =" select" sortOrder =" 40" showInDefault =" 1" showInWebsite =" 1" showInStore =" 1" >
58+ <source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
59+ <label >Allow OAuth Access Tokens to be used as standalone Bearer tokens</label >
60+ </field >
5761 </group >
5862 <group id =" authentication_lock" translate =" label" type =" text" sortOrder =" 400" showInDefault =" 1" >
5963 <label >Authentication Locks</label >
Original file line number Diff line number Diff line change 2020 <comment >If empty, UTF-8 will be used.</comment >
2121 </field >
2222 </group >
23- <group id =" authorization" translate =" label" type =" text" sortOrder =" 15" showInDefault =" 1" showInWebsite =" 1" showInStore =" 1" >
24- <label >Web Api Authentication</label >
25- <field id =" enable_integration_as_bearer" translate =" label" type =" select" sortOrder =" 5" showInDefault =" 1" showInWebsite =" 1" showInStore =" 1" >
26- <source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
27- <label >Enable Input Limits</label >
28- </field >
29- </group >
3023 </section >
3124 </system >
3225</config >
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ public function testIntegrationAsBearerTokenDefault()
9090 /**
9191 * Test Integration access token can be used as Bearer token when explicitly enabled
9292 *
93- * @magentoConfigFixture default_store webapi/authorization /enable_integration_as_bearer 1
93+ * @magentoConfigFixture default_store oauth/consumer /enable_integration_as_bearer 1
9494 * @doesNotPerformAssertions
9595 */
9696 public function testIntegrationAsBearerTokenEnabled ()
You can’t perform that action at this time.
0 commit comments