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
7aa8d285
Commit
7aa8d285
authored
1 year ago
by
lukasmatusiewicz
Browse files
Options
Downloads
Patches
Plain Diff
Update PrivacyIDEA.php
make the fields private, add setters
parent
bdf82528
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/PrivacyIDEA.php
+86
-12
86 additions, 12 deletions
src/PrivacyIDEA.php
with
86 additions
and
12 deletions
src/PrivacyIDEA.php
+
86
−
12
View file @
7aa8d285
...
...
@@ -30,34 +30,34 @@ const ASSERTIONCLIENTEXTENSIONS = "assertionclientextensions";
class
PrivacyIDEA
{
/* @var string User agent name which should be forwarded to the privacyIDEA server. */
p
ublic
string
$userAgent
=
""
;
p
rivate
string
$userAgent
;
/* @var string URL of the privacyIDEA server. */
p
ublic
string
$serverURL
=
""
;
p
rivate
string
$serverURL
;
/* @var string User's realm. */
p
ublic
string
$realm
=
""
;
p
rivate
string
$realm
=
""
;
/* @var bool Disable host verification for SSL. */
p
ublic
bool
$sslVerifyHost
=
true
;
p
rivate
bool
$sslVerifyHost
=
true
;
/* @var bool Disable peer verification for SSL. */
p
ublic
bool
$sslVerifyPeer
=
true
;
p
rivate
bool
$sslVerifyPeer
=
true
;
/* @var string Account name for privacyIDEA service account. Required to use the /validate/triggerchallenge endpoint. */
p
ublic
string
$serviceAccountName
=
""
;
p
rivate
string
$serviceAccountName
=
""
;
/* @var string Password for privacyIDEA service account. Required to use the /validate/triggerchallenge endpoint. */
p
ublic
string
$serviceAccountPass
=
""
;
p
rivate
string
$serviceAccountPass
=
""
;
/* @var string Realm for privacyIDEA service account. Optional to use the /validate/triggerchallenge endpoint. */
p
ublic
string
$serviceAccountRealm
=
""
;
p
rivate
string
$serviceAccountRealm
=
""
;
/* @var bool Send the "client" parameter to allow using the original IP address in the privacyIDEA policies. */
p
ublic
bool
$forwardClientIP
=
false
;
p
rivate
bool
$forwardClientIP
=
false
;
/* @var object|null Implementation of the PILog interface. */
p
ublic
?object
$logger
=
null
;
p
rivate
?object
$logger
=
null
;
/**
* PrivacyIDEA constructor.
...
...
@@ -373,7 +373,7 @@ class PrivacyIDEA
assert
(
'array'
===
gettype
(
$headers
));
assert
(
'string'
===
gettype
(
$httpMethod
));
assert
(
'string'
===
gettype
(
$endpoint
));
// Add the client parameter if wished.
if
(
$this
->
forwardClientIP
===
true
)
{
...
...
@@ -492,4 +492,78 @@ class PrivacyIDEA
{
$this
->
logger
?->
piError
(
"privacyIDEA-PHP-Client: "
.
$message
);
}
}
// Setters
/**
* @param string $realm User's realm.
* @return void
*/
public
function
setRealm
(
string
$realm
):
void
{
$this
->
realm
=
$realm
;
}
/**
* @param bool $sslVerifyHost Disable host verification for SSL.
* @return void
*/
public
function
setSSLVerifyHost
(
bool
$sslVerifyHost
):
void
{
$this
->
sslVerifyHost
=
$sslVerifyHost
;
}
/**
* @param bool $sslVerifyPeer Disable peer verification for SSL.
* @return void
*/
public
function
setSSLVerifyPeer
(
bool
$sslVerifyPeer
):
void
{
$this
->
sslVerifyPeer
=
$sslVerifyPeer
;
}
/**
* @param string $serviceAccountName Account name for privacyIDEA service account. Required to use the /validate/triggerchallenge endpoint.
* @return void
*/
public
function
setServiceAccountName
(
string
$serviceAccountName
):
void
{
$this
->
serviceAccountName
=
$serviceAccountName
;
}
/**
* @param string $serviceAccountPass Password for privacyIDEA service account. Required to use the /validate/triggerchallenge endpoint.
* @return void
*/
public
function
setServiceAccountPass
(
string
$serviceAccountPass
):
void
{
$this
->
serviceAccountPass
=
$serviceAccountPass
;
}
/**
* @param string $serviceAccountRealm Realm for privacyIDEA service account. Optional to use the /validate/triggerchallenge endpoint.
* @return void
*/
public
function
setServiceAccountRealm
(
string
$serviceAccountRealm
):
void
{
$this
->
serviceAccountRealm
=
$serviceAccountRealm
;
}
/**
* @param bool $forwardClientIP Send the "client" parameter to allow using the original IP address in the privacyIDEA policies.
* @return void
*/
public
function
setForwardClientIP
(
bool
$forwardClientIP
):
void
{
$this
->
forwardClientIP
=
$forwardClientIP
;
}
/**
* @param object|null $logger Implementation of the PILog interface.
* @return void
*/
public
function
setLogger
(
?object
$logger
):
void
{
$this
->
logger
=
$logger
;
}
}
\ No newline at end of file
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