forked from Sustainsys/Saml2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move some codes related to metadata to its project
- Loading branch information
Showing
86 changed files
with
961 additions
and
886 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Xml; | ||
|
||
namespace Sustainsys.Saml2.Metadata | ||
{ | ||
public class ContactPerson | ||
{ | ||
public string Company { get; set; } | ||
|
||
public ICollection<string> EmailAddresses { get; private set; } = | ||
new Collection<string>(); | ||
|
||
public string GivenName { get; set; } | ||
public string Surname { get; set; } | ||
|
||
public ICollection<string> TelephoneNumbers { get; private set; } = | ||
new Collection<string>(); | ||
|
||
public ContactType Type { get; set; } | ||
|
||
public ICollection<XmlElement> Extensions { get; private set; } = | ||
new Collection<XmlElement>(); | ||
|
||
public ContactPerson() | ||
{ | ||
} | ||
|
||
public ContactPerson(ContactType type) | ||
{ | ||
Type = type; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace Sustainsys.Saml2.Metadata | ||
{ | ||
public enum ContactType | ||
{ | ||
Unspecified, | ||
Technical, | ||
Support, | ||
Administrative, | ||
Billing, | ||
Other | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Sustainsys.Saml2.Metadata | ||
{ | ||
public class EntityId | ||
{ | ||
public string Id { get; set; } | ||
|
||
public EntityId(string id) | ||
{ | ||
Id = id; | ||
} | ||
|
||
public EntityId() : | ||
this(null) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
|
||
namespace Sustainsys.Saml2.Metadata | ||
{ | ||
// TODO : remove public once all related metadata codes moved to the project | ||
public interface ICachedMetadata | ||
{ | ||
/// <summary> | ||
/// Permitted cache duration for the metadata. | ||
/// </summary> | ||
XsdDuration? CacheDuration { get; set; } | ||
|
||
/// <summary> | ||
/// Valid until | ||
/// </summary> | ||
DateTime? ValidUntil { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Sustainsys.Saml2.Metadata.Localization | ||
{ | ||
public abstract class LocalizedEntry | ||
{ | ||
public string Language { get; set; } | ||
|
||
protected LocalizedEntry() | ||
{ | ||
} | ||
|
||
protected LocalizedEntry(string language) | ||
{ | ||
Language = language; | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
Sustainsys.Saml2.Metadata/Localization/LocalizedEntryCollection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Collections.ObjectModel; | ||
|
||
namespace Sustainsys.Saml2.Metadata.Localization | ||
{ | ||
public class LocalizedEntryCollection<T> : KeyedCollection<string, T> where T : LocalizedEntry | ||
{ | ||
protected override string GetKeyForItem(T item) | ||
{ | ||
return item.Language; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Sustainsys.Saml2.Metadata.Localization | ||
{ | ||
public class LocalizedName : LocalizedEntry | ||
{ | ||
public string Name { get; set; } | ||
|
||
public LocalizedName(string name, string language) : | ||
base(language) | ||
{ | ||
Name = name; | ||
} | ||
|
||
public LocalizedName() | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
|
||
namespace Sustainsys.Saml2.Metadata.Localization | ||
{ | ||
public class LocalizedUri : LocalizedEntry | ||
{ | ||
public Uri Uri { get; set; } | ||
|
||
public LocalizedUri(Uri uri, string language) : | ||
base(language) | ||
{ | ||
Uri = uri; | ||
} | ||
|
||
public LocalizedUri() : | ||
this(null, null) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System; | ||
|
||
namespace Sustainsys.Saml2.Metadata | ||
{ | ||
public class NameIDFormat | ||
{ | ||
public Uri Uri { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Sustainsys.Saml2.Metadata.Localization; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Xml; | ||
|
||
namespace Sustainsys.Saml2.Metadata | ||
{ | ||
public class Organization | ||
{ | ||
public ICollection<XmlElement> Extensions { get; private set; } = | ||
new Collection<XmlElement>(); | ||
|
||
public LocalizedEntryCollection<LocalizedName> DisplayNames { get; private set; } = | ||
new LocalizedEntryCollection<LocalizedName>(); | ||
|
||
public LocalizedEntryCollection<LocalizedName> Names { get; private set; } = | ||
new LocalizedEntryCollection<LocalizedName>(); | ||
|
||
public LocalizedEntryCollection<LocalizedUri> Urls { get; private set; } = | ||
new LocalizedEntryCollection<LocalizedUri>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Sustainsys.Saml2.Metadata | ||
{ | ||
public class ServiceName | ||
{ | ||
public string PortName { get; set; } | ||
public string Name { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Sustainsys.Saml2.Metadata.Services | ||
{ | ||
public class ApplicationService : Endpoint | ||
{ | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Sustainsys.Saml2.Metadata/Services/ArtifactResolutionService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Sustainsys.Saml2.Metadata.Services | ||
{ | ||
public class ArtifactResolutionService : IndexedEndpoint | ||
{ | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Sustainsys.Saml2.Metadata/Services/AssertionConsumerService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Sustainsys.Saml2.Metadata.Services | ||
{ | ||
public class AssertionConsumerService : IndexedEndpoint | ||
{ | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Sustainsys.Saml2.Metadata/Services/AssertionIdRequestService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Sustainsys.Saml2.Metadata.Services | ||
{ | ||
public class AssertionIdRequestService : Endpoint | ||
{ | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
Sustainsys.Saml2.Metadata/Services/AttributeConsumingService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Sustainsys.Saml2.Metadata.Localization; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
|
||
namespace Sustainsys.Saml2.Metadata.Services | ||
{ | ||
/// <summary> | ||
/// Metadata for an attribute consuming service. | ||
/// </summary> | ||
public class AttributeConsumingService : IIndexedEntryWithDefault | ||
{ | ||
/// <summary> | ||
/// Index of the endpoint | ||
/// </summary> | ||
public int Index { get; set; } | ||
|
||
/// <summary> | ||
/// Is this the default endpoint? | ||
/// </summary> | ||
public bool? IsDefault { get; set; } | ||
|
||
/// <summary> | ||
/// Is the service required? | ||
/// </summary> | ||
public bool? IsRequired { get; set; } | ||
|
||
/// <summary> | ||
/// The name of the attribute consuming service. | ||
/// </summary> | ||
public ICollection<LocalizedName> ServiceNames { get; private set; } | ||
= new Collection<LocalizedName>(); | ||
|
||
/// <summary> | ||
/// Description of the attribute consuming service | ||
/// </summary> | ||
public ICollection<LocalizedName> ServiceDescriptions { get; private set; } | ||
= new Collection<LocalizedName>(); | ||
|
||
/// <summary> | ||
/// Requested attributes. | ||
/// </summary> | ||
public ICollection<RequestedAttribute> RequestedAttributes { get; private set; } | ||
= new Collection<RequestedAttribute>(); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...ainsys.Saml2/Metadata/AttributeService.cs → ...ml2.Metadata/Services/AttributeService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace Sustainsys.Saml2.Metadata | ||
namespace Sustainsys.Saml2.Metadata.Services | ||
{ | ||
public class AttributeService : Endpoint | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Sustainsys.Saml2.Metadata.Services | ||
{ | ||
public class AuthnQueryService : Endpoint | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Sustainsys.Saml2.Metadata.Services | ||
{ | ||
public class AuthzService : Endpoint | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
|
||
namespace Sustainsys.Saml2.Metadata.Services | ||
{ | ||
public class Endpoint | ||
{ | ||
public Uri Binding { get; set; } | ||
public Uri Location { get; set; } | ||
public Uri ResponseLocation { get; set; } | ||
|
||
public Endpoint() | ||
{ | ||
} | ||
|
||
public Endpoint(Uri binding, Uri location) | ||
{ | ||
Binding = binding; | ||
Location = location; | ||
} | ||
} | ||
} |
Oops, something went wrong.