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
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
d66068e8
Commit
d66068e8
authored
9 years ago
by
Jaime Perez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Fix phpdoc comments for SimpleSAML_Metadata_SAMLBuilder.
parent
f906c300
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
lib/SimpleSAML/Metadata/SAMLBuilder.php
+65
-45
65 additions, 45 deletions
lib/SimpleSAML/Metadata/SAMLBuilder.php
with
65 additions
and
45 deletions
lib/SimpleSAML/Metadata/SAMLBuilder.php
+
65
−
45
View file @
d66068e8
...
@@ -13,17 +13,34 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -13,17 +13,34 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* The EntityDescriptor we are building.
* The EntityDescriptor we are building.
*
* @var string
*/
*/
private
$entityDescriptor
;
private
$entityDescriptor
;
/**
* The maximum time in seconds the metadata should be cached.
*
* @var int|null
*/
private
$maxCache
=
NULL
;
private
$maxCache
=
NULL
;
/**
* The maximum time in seconds since the current time that this metadata should be considered valid.
*
* @var int|null
*/
private
$maxDuration
=
NULL
;
private
$maxDuration
=
NULL
;
/**
/**
* Initialize the builder.
* Initialize the
SAML
builder.
*
*
* @param string $entityId The entity id of the entity.
* @param string $entityId The entity id of the entity.
* @param int|null $maxCache The maximum time in seconds the metadata should be cached. Defaults to null
* @param int|null $maxDuration The maximum time in seconds this metadata should be considered valid. Defaults
* to null.
*/
*/
public
function
__construct
(
$entityId
,
$maxCache
=
NULL
,
$maxDuration
=
NULL
)
{
public
function
__construct
(
$entityId
,
$maxCache
=
NULL
,
$maxDuration
=
NULL
)
{
assert
(
'is_string($entityId)'
);
assert
(
'is_string($entityId)'
);
...
@@ -50,10 +67,9 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -50,10 +67,9 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* Retrieve the EntityDescriptor.
*
* Retrieve the EntityDescriptor element which is generated for this entity.
* Retrieve the EntityDescriptor element which is generated for this entity.
* @return DOMElement The EntityDescriptor element for this entity.
*
* @return DOMElement The EntityDescriptor element of this entity.
*/
*/
public
function
getEntityDescriptor
()
{
public
function
getEntityDescriptor
()
{
...
@@ -69,9 +85,8 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -69,9 +85,8 @@ class SimpleSAML_Metadata_SAMLBuilder {
*
*
* This function serializes this EntityDescriptor, and returns it as text.
* This function serializes this EntityDescriptor, and returns it as text.
*
*
* @param bool $formatted Whether the returned EntityDescriptor should be
* @param bool $formatted Whether the returned EntityDescriptor should be formatted first.
* formatted first.
* @return string The serialized EntityDescriptor.
* @return string The serialized EntityDescriptor.
*/
*/
public
function
getEntityDescriptorText
(
$formatted
=
TRUE
)
{
public
function
getEntityDescriptorText
(
$formatted
=
TRUE
)
{
assert
(
'is_bool($formatted)'
);
assert
(
'is_bool($formatted)'
);
...
@@ -84,6 +99,12 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -84,6 +99,12 @@ class SimpleSAML_Metadata_SAMLBuilder {
return
$xml
->
ownerDocument
->
saveXML
();
return
$xml
->
ownerDocument
->
saveXML
();
}
}
/**
* Add a SecurityTokenServiceType for ADFS metadata.
*
* @param array $metadata The metadata with the information about the SecurityTokenServiceType.
*/
public
function
addSecurityTokenServiceType
(
$metadata
)
{
public
function
addSecurityTokenServiceType
(
$metadata
)
{
assert
(
'is_array($metadata)'
);
assert
(
'is_array($metadata)'
);
assert
(
'isset($metadata["entityid"])'
);
assert
(
'isset($metadata["entityid"])'
);
...
@@ -100,8 +121,10 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -100,8 +121,10 @@ class SimpleSAML_Metadata_SAMLBuilder {
}
}
/**
/**
* @param SimpleSAML_Configuration $metadata Metadata.
* Add extensions to the metadata.
* @param $e Reference to the element where the Extensions element should be included.
*
* @param SimpleSAML_Configuration $metadata The metadata to get extensions from.
* @param SAML2_XML_md_RoleDescriptor $e Reference to the element where the Extensions element should be included.
*/
*/
private
function
addExtensions
(
SimpleSAML_Configuration
$metadata
,
SAML2_XML_md_RoleDescriptor
$e
)
{
private
function
addExtensions
(
SimpleSAML_Configuration
$metadata
,
SAML2_XML_md_RoleDescriptor
$e
)
{
...
@@ -241,13 +264,11 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -241,13 +264,11 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* Add Organization element
.
* Add
an
Organization element
based on data passed as parameters
*
*
* This function adds an organization element to the metadata.
* @param array $orgName An array with the localized OrganizationName.
*
* @param array $orgDisplayName An array with the localized OrganizationDisplayName.
* @param array $orgName An array with the localized OrganizatioName.
* @param array $orgURL An array with the localized OrganizationURL.
* @param array $orgDisplayName An array with the localized OrganizatioDisplayName.
* @param array $orgURL An array with the localized OrganizatioURL.
*/
*/
public
function
addOrganization
(
array
$orgName
,
array
$orgDisplayName
,
array
$orgURL
)
{
public
function
addOrganization
(
array
$orgName
,
array
$orgDisplayName
,
array
$orgURL
)
{
...
@@ -262,9 +283,9 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -262,9 +283,9 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* Add
o
rganization element based on metadata array.
* Add
an O
rganization element based on metadata array.
*
*
* @param array $metadata
The metadata we should extract the organization information from.
* @param array $metadata The metadata we should extract the organization information from.
*/
*/
public
function
addOrganizationInfo
(
array
$metadata
)
{
public
function
addOrganizationInfo
(
array
$metadata
)
{
...
@@ -286,11 +307,11 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -286,11 +307,11 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* Add endpoint
list
to metadata.
* Add
a list of
endpoint
s
to metadata.
*
*
* @param array $endpoints
The endpoints.
* @param array $endpoints The endpoints.
* @param bool $indexed
Whether the endpoints should be indexed.
* @param bool $indexed Whether the endpoints should be indexed.
* @return
array A
rray of endpoint objects.
* @return
SAML2_XML_md_IndexedEndpointType[]|SAML2_XML_md_EndpointType[] An a
rray of endpoint objects.
*/
*/
private
static
function
createEndpoints
(
array
$endpoints
,
$indexed
)
{
private
static
function
createEndpoints
(
array
$endpoints
,
$indexed
)
{
assert
(
'is_bool($indexed)'
);
assert
(
'is_bool($indexed)'
);
...
@@ -343,8 +364,8 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -343,8 +364,8 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* Add an AttributeConsumingService element to the metadata.
* Add an AttributeConsumingService element to the metadata.
*
*
* @param
DOMElement
$spDesc
The SPSSODescriptor element.
* @param
SAML2_XML_md_SPSSODescriptor
$spDesc The SPSSODescriptor element.
* @param SimpleSAML_Configuration $metadata
The metadata.
* @param SimpleSAML_Configuration $metadata The metadata.
*/
*/
private
function
addAttributeConsumingService
(
SAML2_XML_md_SPSSODescriptor
$spDesc
,
SimpleSAML_Configuration
$metadata
)
{
private
function
addAttributeConsumingService
(
SAML2_XML_md_SPSSODescriptor
$spDesc
,
SimpleSAML_Configuration
$metadata
)
{
$attributes
=
$metadata
->
getArray
(
'attributes'
,
array
());
$attributes
=
$metadata
->
getArray
(
'attributes'
,
array
());
...
@@ -389,12 +410,10 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -389,12 +410,10 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* Add metadata set for entity.
* Add a specific type of metadata to an entity.
*
* This function is used to add a metadata array to the entity.
*
*
* @param string $set
The metadata set this metadata comes from.
* @param string $set The metadata set this metadata comes from.
* @param array $metadata
The metadata.
* @param array $metadata The metadata.
*/
*/
public
function
addMetadata
(
$set
,
$metadata
)
{
public
function
addMetadata
(
$set
,
$metadata
)
{
assert
(
'is_string($set)'
);
assert
(
'is_string($set)'
);
...
@@ -427,8 +446,8 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -427,8 +446,8 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* Add SAML 2.0 SP metadata.
* Add SAML 2.0 SP metadata.
*
*
* @param array $metadata
The metadata.
* @param array $metadata The metadata.
* @param array $protocols The protocols supported.
* @param array $protocols The protocols supported.
Defaults to SAML2_Const::NS_SAMLP.
*/
*/
public
function
addMetadataSP20
(
$metadata
,
$protocols
=
array
(
SAML2_Const
::
NS_SAMLP
))
{
public
function
addMetadataSP20
(
$metadata
,
$protocols
=
array
(
SAML2_Const
::
NS_SAMLP
))
{
assert
(
'is_array($metadata)'
);
assert
(
'is_array($metadata)'
);
...
@@ -482,9 +501,9 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -482,9 +501,9 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* Add
SAML 2.0 IdP metadata
.
* Add
metadata of a SAML 2.0 identity provider
.
*
*
* @param array $metadata
The metadata.
* @param array $metadata The metadata.
*/
*/
public
function
addMetadataIdP20
(
$metadata
)
{
public
function
addMetadataIdP20
(
$metadata
)
{
assert
(
'is_array($metadata)'
);
assert
(
'is_array($metadata)'
);
...
@@ -528,9 +547,9 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -528,9 +547,9 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* Add
SAML 1.1 SP metadata
.
* Add
metadata of a SAML 1.1 service provider
.
*
*
* @param array $metadata
The metadata.
* @param array $metadata The metadata.
*/
*/
public
function
addMetadataSP11
(
$metadata
)
{
public
function
addMetadataSP11
(
$metadata
)
{
assert
(
'is_array($metadata)'
);
assert
(
'is_array($metadata)'
);
...
@@ -562,9 +581,9 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -562,9 +581,9 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* Add
SAML 1.1 IdP metadata
.
* Add
metadata of a SAML 1.1 identity provider
.
*
*
* @param array $metadata
The metadata.
* @param array $metadata The metadata.
*/
*/
public
function
addMetadataIdP11
(
$metadata
)
{
public
function
addMetadataIdP11
(
$metadata
)
{
assert
(
'is_array($metadata)'
);
assert
(
'is_array($metadata)'
);
...
@@ -588,9 +607,10 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -588,9 +607,10 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* Add
a A
ttribute
A
uthority
Descriptor
.
* Add
metadata of a SAML a
ttribute
a
uthority.
*
*
* @param array $metadata The AttributeAuthorityDescriptor, in the format returned by SAMLParser.
* @param array $metadata The AttributeAuthorityDescriptor, in the format returned by
* SimpleSAML_Metadata_SAMLParser.
*/
*/
public
function
addAttributeAuthority
(
array
$metadata
)
{
public
function
addAttributeAuthority
(
array
$metadata
)
{
assert
(
'is_array($metadata)'
);
assert
(
'is_array($metadata)'
);
...
@@ -675,9 +695,9 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -675,9 +695,9 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* Add a KeyDescriptor with an X509 certificate.
* Add a KeyDescriptor with an X509 certificate.
*
*
* @param SAML2_XML_md_RoleDescriptor $rd
The RoleDescriptor the certificate should be added to.
* @param SAML2_XML_md_RoleDescriptor $rd The RoleDescriptor the certificate should be added to.
* @param string $use
The value of the use
-
attribute.
* @param string $use The value of the
'
use
'
attribute.
* @param string $x509data
The certificate data.
* @param string $x509data The certificate data.
*/
*/
private
function
addX509KeyDescriptor
(
SAML2_XML_md_RoleDescriptor
$rd
,
$use
,
$x509data
)
{
private
function
addX509KeyDescriptor
(
SAML2_XML_md_RoleDescriptor
$rd
,
$use
,
$x509data
)
{
assert
(
'in_array($use, array("encryption", "signing"), TRUE)'
);
assert
(
'in_array($use, array("encryption", "signing"), TRUE)'
);
...
@@ -690,12 +710,12 @@ class SimpleSAML_Metadata_SAMLBuilder {
...
@@ -690,12 +710,12 @@ class SimpleSAML_Metadata_SAMLBuilder {
/**
/**
* Add certificate.
* Add
a
certificate.
*
*
* Helper function for adding a certificate to the metadata.
* Helper function for adding a certificate to the metadata.
*
*
* @param SAML2_XML_md_RoleDescriptor $rd
The RoleDescriptor the certificate should be added to.
* @param SAML2_XML_md_RoleDescriptor $rd The RoleDescriptor the certificate should be added to.
* @param SimpleSAML_Configuration $metadata
The metadata f
or
the entity.
* @param SimpleSAML_Configuration $metadata The metadata
o
f the entity.
*/
*/
private
function
addCertificate
(
SAML2_XML_md_RoleDescriptor
$rd
,
SimpleSAML_Configuration
$metadata
)
{
private
function
addCertificate
(
SAML2_XML_md_RoleDescriptor
$rd
,
SimpleSAML_Configuration
$metadata
)
{
...
...
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