/** * Get the set of non-visibly used namespaces used on the owning XMLObject (only the owner, * not the owner's children). * * @return the set of non-visibly-used namespaces */ @Nonnull private Set<Namespace> getNonVisibleNamespaceCandidates() { LazySet<Namespace> namespaces = new LazySet<>(); // Add xsi:type value's prefix, if element carries an xsi:type if (getElementTypeNamespace() != null) { namespaces.add(getElementTypeNamespace()); } // Add prefixes from attribute and content values for (Namespace attribValue : attrValues.values()) { if (attribValue != null) { namespaces.add(attribValue); } } if (contentValue != null) { namespaces.add(contentValue); } return namespaces; }
/** * Get the set of all namespaces which are in scope within the subtree rooted * at the owning XMLObject. * * @return set of all namespaces in scope for the owning object */ @Nonnull public Set<Namespace> getAllNamespacesInSubtreeScope() { LazySet<Namespace> namespaces = new LazySet<>(); // Collect namespaces for the subtree rooted at each child List<XMLObject> children = getOwner().getOrderedChildren(); if (children != null) { for(XMLObject child : children) { if (child != null) { Set<Namespace> childNamespaces = child.getNamespaceManager().getAllNamespacesInSubtreeScope(); if (!childNamespaces.isEmpty()) { namespaces.addAll(childNamespaces); } } } } // Collect this node's namespaces. for (Namespace myNS : getNamespaces()) { namespaces.add(myNS); } return namespaces; }
/** * Get the set of non-visibly used namespaces used on the owning XMLObject (only the owner, * not the owner's children). * * @return the set of non-visibly-used namespaces */ @Nonnull private Set<Namespace> getNonVisibleNamespaceCandidates() { LazySet<Namespace> namespaces = new LazySet<>(); // Add xsi:type value's prefix, if element carries an xsi:type if (getElementTypeNamespace() != null) { namespaces.add(getElementTypeNamespace()); } // Add prefixes from attribute and content values for (Namespace attribValue : attrValues.values()) { if (attribValue != null) { namespaces.add(attribValue); } } if (contentValue != null) { namespaces.add(contentValue); } return namespaces; }
/** * Get the set of all namespaces which are in scope within the subtree rooted * at the owning XMLObject. * * @return set of all namespaces in scope for the owning object */ @Nonnull public Set<Namespace> getAllNamespacesInSubtreeScope() { LazySet<Namespace> namespaces = new LazySet<>(); // Collect namespaces for the subtree rooted at each child List<XMLObject> children = getOwner().getOrderedChildren(); if (children != null) { for(XMLObject child : children) { if (child != null) { Set<Namespace> childNamespaces = child.getNamespaceManager().getAllNamespacesInSubtreeScope(); if (!childNamespaces.isEmpty()) { namespaces.addAll(childNamespaces); } } } } // Collect this node's namespaces. for (Namespace myNS : getNamespaces()) { namespaces.add(myNS); } return namespaces; }
/** * Get the set of namespaces which are currently visibly-used on the owning XMLObject (only the owner, * not its children). * * @return the set of visibly-used namespaces */ @Nonnull private Set<Namespace> getVisibleNamespaces() { LazySet<Namespace> namespaces = new LazySet<>(); // Add namespace from element name. if (getElementNameNamespace() != null) { namespaces.add(getElementNameNamespace()); } // Add xsi attribute prefix, if element carries an xsi:type. if (getElementTypeNamespace() != null) { namespaces.add(XSI_NAMESPACE); } // Add namespaces from attribute names for (Namespace attribName : attrNames) { if (attribName != null) { namespaces.add(attribName); } } return namespaces; }
/** * Get the set of namespaces which are currently visibly-used on the owning XMLObject (only the owner, * not its children). * * @return the set of visibly-used namespaces */ @Nonnull private Set<Namespace> getVisibleNamespaces() { LazySet<Namespace> namespaces = new LazySet<>(); // Add namespace from element name. if (getElementNameNamespace() != null) { namespaces.add(getElementNameNamespace()); } // Add xsi attribute prefix, if element carries an xsi:type. if (getElementTypeNamespace() != null) { namespaces.add(XSI_NAMESPACE); } // Add namespaces from attribute names for (Namespace attribName : attrNames) { if (attribName != null) { namespaces.add(attribName); } } return namespaces; }
/** * Get the valid audiences for attestation. * * <p> * This implementation returns a set containing the single entityID held by the message context's * {@link SAMLSelfEntityContext#getEntityId()}, if present. Otherwise an empty set is returned. * </p> * * @param input the assertion validation input * * @return set of audience URI's */ @Nonnull protected Set<String> getValidAudiences(@Nonnull final SAML20AssertionTokenValidationInput input) { LazySet<String> validAudiences = new LazySet<>(); SAMLSelfEntityContext selfContext = input.getMessageContext().getSubcontext(SAMLSelfEntityContext.class); if (selfContext != null && selfContext.getEntityId() != null) { validAudiences.add(selfContext.getEntityId()); } log.debug("Resolved valid audiences set: {}", validAudiences); return validAudiences; }
/** {@inheritDoc} */ @Nullable public Set<MetadataIndexKey> generateKeys(@Nonnull CriteriaSet criteriaSet) { Constraint.isNotNull(criteriaSet, "CriteriaSet was null"); ArtifactCriterion artifactCrit = criteriaSet.get(ArtifactCriterion.class); if (artifactCrit != null) { LazySet<MetadataIndexKey> results = new LazySet<>(); SAMLArtifact artifact = artifactCrit.getArtifact(); if (artifact instanceof SAMLSourceIDArtifact) { results.add(new ArtifactSourceIDMetadataIndexKey(((SAMLSourceIDArtifact)artifact).getSourceID())); } if (artifact instanceof SAMLSourceLocationArtifact) { results.add(new ArtifactSourceLocationMetadataIndexKey( ((SAMLSourceLocationArtifact)artifact).getSourceLocation())); } return results; } else { return null; } }
log.trace("For SourceID extension value '{}' produced index key: {}", extSourceIDHex, key); results.add(key); } catch (DecoderException e) { log.warn("Error decoding hexidecimal SourceID extension value '{}' for indexing",
log.trace("For entityID '{}' produced artifact source location index key: {}", descriptor.getEntityID(), key); results.add(key);
monitor.size()); resolvedAttributes.add(resolvedAttribute);