Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
php-client
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Perun
Perun ProxyIdP
php-client
Commits
caea1051
Unverified
Commit
caea1051
authored
2 years ago
by
lukasmatusiewicz
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
24 translate the preferred client mode to used in the plugins (#25)
* add the translation * Update tests
parent
e04f9f0c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/PIResponse.php
+13
-1
13 additions, 1 deletion
src/PIResponse.php
test/PollTransactionTest.php
+1
-1
1 addition, 1 deletion
test/PollTransactionTest.php
test/TriggerChallengeTest.php
+1
-1
1 addition, 1 deletion
test/TriggerChallengeTest.php
with
15 additions
and
3 deletions
src/PIResponse.php
+
13
−
1
View file @
caea1051
...
...
@@ -90,7 +90,19 @@ class PIResponse
}
if
(
isset
(
$map
[
'detail'
][
'preferred_client_mode'
]))
{
$ret
->
preferredClientMode
=
$map
[
'detail'
][
'preferred_client_mode'
];
$pref
=
$map
[
'detail'
][
'preferred_client_mode'
];
if
(
$pref
===
"poll"
)
{
$ret
->
preferredClientMode
=
"push"
;
}
elseif
(
$pref
===
"interactive"
)
{
$ret
->
preferredClientMode
=
"otp"
;
}
else
{
$ret
->
preferredClientMode
=
$map
[
'detail'
][
'preferred_client_mode'
];
}
}
// Check that the authentication status is one of the allowed ones
...
...
This diff is collapsed.
Click to expand it.
test/PollTransactionTest.php
+
1
−
1
View file @
caea1051
...
...
@@ -40,7 +40,7 @@ class PollTransactionTest extends TestCase implements PILog
*/
public
function
testTriggerPUSH
()
{
$responseBody
=
"{\n"
.
"
\"
detail
\"
: {\n"
.
"
\"
preferred_client_mode
\"
:
\"
p
ush
\"
,"
.
"
\"
attributes
\"
: null,
\n
"
.
$responseBody
=
"{\n"
.
"
\"
detail
\"
: {\n"
.
"
\"
preferred_client_mode
\"
:
\"
p
oll
\"
,"
.
"
\"
attributes
\"
: null,
\n
"
.
"
\"
message
\"
:
\"
Bitte geben Sie einen OTP-Wert ein: , Please confirm the authentication on your mobile device!
\"
,
\n
"
.
"
\"
messages
\"
: [
\n
"
.
"
\"
Bitte geben Sie einen OTP-Wert ein:
\"
,
\n
"
.
"
\"
Please confirm the authentication on your mobile device!
\"\n
"
.
" ],
\n
"
.
...
...
This diff is collapsed.
Click to expand it.
test/TriggerChallengeTest.php
+
1
−
1
View file @
caea1051
...
...
@@ -85,7 +85,7 @@ class TriggerChallengeTest extends TestCase implements PILog
$this
->
assertEquals
(
"BittegebenSieeinenOTP-Wertein:"
,
$response
->
message
);
$this
->
assertEquals
(
"BittegebenSieeinenOTP-Wertein:"
,
$response
->
messages
);
$this
->
assertEquals
(
"16734787285577957577"
,
$response
->
transactionID
);
$this
->
assertEquals
(
"
interactive
"
,
$response
->
preferredClientMode
);
$this
->
assertEquals
(
"
otp
"
,
$response
->
preferredClientMode
);
$this
->
assertTrue
(
$response
->
status
);
$this
->
assertFalse
(
$response
->
value
);
$this
->
assertEquals
(
"totp"
,
$response
->
triggeredTokenTypes
()[
0
]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment