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 6
6
7
7
declare (strict_types=1 );
8
8
9
- namespace Magento \Webapi \Model \Authorization ;
9
+ namespace Magento \Integration \Model \Config ;
10
10
11
11
use Magento \Framework \App \Config \ScopeConfigInterface ;
12
12
use Magento \Store \Model \ScopeInterface ;
@@ -19,7 +19,7 @@ class AuthorizationConfig
19
19
/**
20
20
* XML Path for Enable Integration as Bearer
21
21
*/
22
- const CONFIG_PATH_INTEGRATION_BEARER = 'webapi/authorization /enable_integration_as_bearer ' ;
22
+ const CONFIG_PATH_INTEGRATION_BEARER = 'oauth/consumer /enable_integration_as_bearer ' ;
23
23
24
24
/**
25
25
* @var ScopeConfigInterface
Original file line number Diff line number Diff line change 13
13
use Magento \Integration \Api \Exception \UserTokenException ;
14
14
use Magento \Integration \Api \IntegrationServiceInterface ;
15
15
use Magento \Integration \Api \UserTokenReaderInterface ;
16
+ use Magento \Integration \Model \Config \AuthorizationConfig ;
16
17
use Magento \Integration \Model \CustomUserContext ;
17
18
use Magento \Integration \Model \Oauth \Token ;
18
19
use Magento \Integration \Model \Oauth \TokenFactory ;
19
20
use Magento \Integration \Helper \Oauth \Data as OauthHelper ;
20
- use Magento \Webapi \Model \Authorization \AuthorizationConfig ;
21
21
22
22
/**
23
23
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -147,6 +147,6 @@ private function getUserId(Token $tokenModel): int
147
147
throw new UserTokenException ('Invalid token found ' );
148
148
}
149
149
150
- return $ userId ;
150
+ return ( int ) $ userId ;
151
151
}
152
152
}
Original file line number Diff line number Diff line change 6
6
7
7
declare (strict_types=1 );
8
8
9
- namespace Magento \Webapi \Test \Unit \Model \Authorization ;
9
+ namespace Magento \Integration \Test \Unit \Model \ Config \Authorization ;
10
10
11
11
use Magento \Framework \App \Config \ScopeConfigInterface ;
12
- use Magento \Webapi \Model \Authorization \AuthorizationConfig ;
12
+ use Magento \Integration \Model \Config \AuthorizationConfig ;
13
13
use PHPUnit \Framework \MockObject \MockObject ;
14
14
use PHPUnit \Framework \TestCase ;
15
15
@@ -34,7 +34,7 @@ protected function setUp(): void
34
34
public function testEnabled ()
35
35
{
36
36
$ this ->scopeConfig ->method ('isSetFlag ' )
37
- ->with ('webapi/authorization /enable_integration_as_bearer ' )
37
+ ->with ('oauth/consumer /enable_integration_as_bearer ' )
38
38
->willReturn (true );
39
39
40
40
self ::assertTrue ($ this ->config ->isIntegrationAsBearerEnabled ());
@@ -43,7 +43,7 @@ public function testEnabled()
43
43
public function testDisabled ()
44
44
{
45
45
$ this ->scopeConfig ->method ('isSetFlag ' )
46
- ->with ('webapi/authorization /enable_integration_as_bearer ' )
46
+ ->with ('oauth/consumer /enable_integration_as_bearer ' )
47
47
->willReturn (false );
48
48
49
49
self ::assertFalse ($ this ->config ->isIntegrationAsBearerEnabled ());
Original file line number Diff line number Diff line change 54
54
<comment >Timeout for OAuth consumer credentials Post request within X seconds.</comment >
55
55
<validate >required-entry validate-zero-or-greater validate-number</validate >
56
56
</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 >
57
61
</group >
58
62
<group id =" authentication_lock" translate =" label" type =" text" sortOrder =" 400" showInDefault =" 1" >
59
63
<label >Authentication Locks</label >
Original file line number Diff line number Diff line change 20
20
<comment >If empty, UTF-8 will be used.</comment >
21
21
</field >
22
22
</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 >
30
23
</section >
31
24
</system >
32
25
</config >
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ public function testIntegrationAsBearerTokenDefault()
90
90
/**
91
91
* Test Integration access token can be used as Bearer token when explicitly enabled
92
92
*
93
- * @magentoConfigFixture default_store webapi/authorization /enable_integration_as_bearer 1
93
+ * @magentoConfigFixture default_store oauth/consumer /enable_integration_as_bearer 1
94
94
* @doesNotPerformAssertions
95
95
*/
96
96
public function testIntegrationAsBearerTokenEnabled ()
You can’t perform that action at this time.
0 commit comments