|
1
|
|
|
<?php declare(strict_types = 1); |
|
2
|
|
|
|
|
3
|
|
|
namespace AtlassianConnectBundle\Tests\Security; |
|
4
|
|
|
|
|
5
|
|
|
use AtlassianConnectBundle\Entity\TenantInterface; |
|
6
|
|
|
use Symfony\Component\Security\Core\Role\Role; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Class StubbedTenant |
|
10
|
|
|
*/ |
|
11
|
|
|
class StubbedTenant implements TenantInterface |
|
12
|
|
|
{ |
|
13
|
|
|
/** |
|
14
|
|
|
* @return array<string>|array<Role> |
|
15
|
|
|
*/ |
|
16
|
|
|
public function getRoles(): array |
|
17
|
|
|
{ |
|
18
|
|
|
return ['ROLE_USER']; |
|
19
|
|
|
} |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* @return string|null |
|
23
|
|
|
*/ |
|
24
|
|
|
public function getSharedSecret(): ?string |
|
25
|
|
|
{ |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @return string|null |
|
30
|
|
|
*/ |
|
31
|
|
|
public function getOauthClientId(): ?string |
|
32
|
|
|
{ |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @return string|null |
|
37
|
|
|
*/ |
|
38
|
|
|
public function getBaseUrl(): ?string |
|
39
|
|
|
{ |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @return string|null |
|
44
|
|
|
*/ |
|
45
|
|
|
public function getAddonKey(): ?string |
|
46
|
|
|
{ |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* @param string $name |
|
51
|
|
|
* |
|
52
|
|
|
* @return TenantInterface |
|
53
|
|
|
*/ |
|
54
|
|
|
public function setUsername(string $name): TenantInterface |
|
55
|
|
|
{ |
|
56
|
|
|
} |
|
|
|
|
|
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @param string $addonKey |
|
60
|
|
|
* |
|
61
|
|
|
* @return TenantInterface |
|
62
|
|
|
*/ |
|
63
|
|
|
public function setAddonKey(string $addonKey): TenantInterface |
|
64
|
|
|
{ |
|
65
|
|
|
} |
|
|
|
|
|
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* @param string $clientKey |
|
69
|
|
|
* |
|
70
|
|
|
* @return TenantInterface |
|
71
|
|
|
*/ |
|
72
|
|
|
public function setClientKey(string $clientKey): TenantInterface |
|
73
|
|
|
{ |
|
74
|
|
|
} |
|
|
|
|
|
|
75
|
|
|
|
|
76
|
|
|
/** |
|
77
|
|
|
* @param string $publicKey |
|
78
|
|
|
* |
|
79
|
|
|
* @return TenantInterface |
|
80
|
|
|
*/ |
|
81
|
|
|
public function setPublicKey(string $publicKey): TenantInterface |
|
82
|
|
|
{ |
|
83
|
|
|
} |
|
|
|
|
|
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* @param string $sharedSecret |
|
87
|
|
|
* |
|
88
|
|
|
* @return TenantInterface |
|
89
|
|
|
*/ |
|
90
|
|
|
public function setSharedSecret(string $sharedSecret): TenantInterface |
|
91
|
|
|
{ |
|
92
|
|
|
} |
|
|
|
|
|
|
93
|
|
|
|
|
94
|
|
|
/** |
|
95
|
|
|
* @param string $serverVersion |
|
96
|
|
|
* |
|
97
|
|
|
* @return TenantInterface |
|
98
|
|
|
*/ |
|
99
|
|
|
public function setServerVersion(string $serverVersion): TenantInterface |
|
100
|
|
|
{ |
|
101
|
|
|
} |
|
|
|
|
|
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* @param string $pluginsVersion |
|
105
|
|
|
* |
|
106
|
|
|
* @return TenantInterface |
|
107
|
|
|
*/ |
|
108
|
|
|
public function setPluginsVersion(string $pluginsVersion): TenantInterface |
|
109
|
|
|
{ |
|
110
|
|
|
} |
|
|
|
|
|
|
111
|
|
|
|
|
112
|
|
|
/** |
|
113
|
|
|
* @param string $baseUrl |
|
114
|
|
|
* |
|
115
|
|
|
* @return TenantInterface |
|
116
|
|
|
*/ |
|
117
|
|
|
public function setBaseUrl(string $baseUrl): TenantInterface |
|
118
|
|
|
{ |
|
119
|
|
|
} |
|
|
|
|
|
|
120
|
|
|
|
|
121
|
|
|
/** |
|
122
|
|
|
* @param string $productType |
|
123
|
|
|
* |
|
124
|
|
|
* @return TenantInterface |
|
125
|
|
|
*/ |
|
126
|
|
|
public function setProductType(string $productType): TenantInterface |
|
127
|
|
|
{ |
|
128
|
|
|
} |
|
|
|
|
|
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* @param string $description |
|
132
|
|
|
* |
|
133
|
|
|
* @return TenantInterface |
|
134
|
|
|
*/ |
|
135
|
|
|
public function setDescription(string $description): TenantInterface |
|
136
|
|
|
{ |
|
137
|
|
|
} |
|
|
|
|
|
|
138
|
|
|
|
|
139
|
|
|
/** |
|
140
|
|
|
* @param string $eventType |
|
141
|
|
|
* |
|
142
|
|
|
* @return TenantInterface |
|
143
|
|
|
*/ |
|
144
|
|
|
public function setEventType(string $eventType): TenantInterface |
|
145
|
|
|
{ |
|
146
|
|
|
} |
|
|
|
|
|
|
147
|
|
|
|
|
148
|
|
|
/** |
|
149
|
|
|
* @param string|null $oauthClientId |
|
150
|
|
|
* |
|
151
|
|
|
* @return TenantInterface |
|
152
|
|
|
*/ |
|
153
|
|
|
public function setOauthClientId(?string $oauthClientId): TenantInterface |
|
154
|
|
|
{ |
|
155
|
|
|
} |
|
|
|
|
|
|
156
|
|
|
|
|
157
|
|
|
/** |
|
158
|
|
|
* @return string|void |
|
159
|
|
|
*/ |
|
160
|
|
|
public function getPassword(): ?string |
|
161
|
|
|
{ |
|
162
|
|
|
} |
|
163
|
|
|
|
|
164
|
|
|
/** |
|
165
|
|
|
* @return string|null |
|
166
|
|
|
*/ |
|
167
|
|
|
public function getSalt(): ?string |
|
168
|
|
|
{ |
|
169
|
|
|
} |
|
170
|
|
|
|
|
171
|
|
|
/** |
|
172
|
|
|
* @return string|null |
|
173
|
|
|
*/ |
|
174
|
|
|
public function getUsername(): ?string |
|
175
|
|
|
{ |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
public function getUserIdentifier(): string |
|
179
|
|
|
{ |
|
180
|
|
|
return 'tenant'; |
|
181
|
|
|
} |
|
182
|
|
|
|
|
183
|
|
|
/** |
|
184
|
|
|
* @return void |
|
185
|
|
|
*/ |
|
186
|
|
|
public function eraseCredentials(): void |
|
187
|
|
|
{ |
|
188
|
|
|
} |
|
189
|
|
|
} |
|
190
|
|
|
|
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: