Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
e1400c21
Commit
e1400c21
authored
Jul 5, 2023
by
Tamilselvan Sekar
Committed by
Thijs Kinkhorst
Jul 6, 2023
Browse files
Options
Downloads
Patches
Plain Diff
feat(pdo): add removeEntry method to clear expired metadata
parent
e1f713f7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php
+25
-0
25 additions, 0 deletions
src/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php
with
25 additions
and
0 deletions
src/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php
+
25
−
0
View file @
e1400c21
...
@@ -255,6 +255,31 @@ class MetaDataStorageHandlerPdo extends MetaDataStorageSource
...
@@ -255,6 +255,31 @@ class MetaDataStorageHandlerPdo extends MetaDataStorageSource
}
}
/**
* Remove metadata from the configured database
*
* @param string $entityId The entityId we are removing.
* @param string $set The set to remove the metadata from.
*
* @return bool True/False if entry was successfully deleted
*/
public
function
removeEntry
(
string
$entityId
,
string
$set
):
bool
{
if
(
!
in_array
(
$set
,
$this
->
supportedSets
,
true
))
{
return
false
;
}
$tableName
=
$this
->
getTableName
(
$set
);
$rows
=
$this
->
db
->
write
(
"DELETE FROM
$tableName
WHERE entity_id = :entity_id"
,
[
'entity_id'
=>
$entityId
]
);
return
$rows
===
1
;
}
/**
/**
* Replace the -'s to an _ in table names for Metadata sets
* Replace the -'s to an _ in table names for Metadata sets
* since SQL does not allow a - in a table name.
* since SQL does not allow a - in a table name.
...
...
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