summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth/ServiceProviderEndpoint.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-09-23 08:08:04 -0700
committerAndrew <andrewarnott@gmail.com>2008-09-23 08:08:04 -0700
commit22341a07b0ba0dc685bb859b0ed82c22fc3c09db (patch)
tree3a735cce2271b5b7b276bf5e4620348580726ba4 /src/DotNetOAuth/ServiceProviderEndpoint.cs
parent77adf75348090e79d3e93bff78a74c8688d8b58b (diff)
downloadDotNetOpenAuth-22341a07b0ba0dc685bb859b0ed82c22fc3c09db.zip
DotNetOpenAuth-22341a07b0ba0dc685bb859b0ed82c22fc3c09db.tar.gz
DotNetOpenAuth-22341a07b0ba0dc685bb859b0ed82c22fc3c09db.tar.bz2
Implementing and refactoring ServiceProvider and Consumer classes.
Beginning to write a test for the spec's appendix A scenario.
Diffstat (limited to 'src/DotNetOAuth/ServiceProviderEndpoint.cs')
-rw-r--r--src/DotNetOAuth/ServiceProviderEndpoint.cs53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/DotNetOAuth/ServiceProviderEndpoint.cs b/src/DotNetOAuth/ServiceProviderEndpoint.cs
new file mode 100644
index 0000000..89f5e61
--- /dev/null
+++ b/src/DotNetOAuth/ServiceProviderEndpoint.cs
@@ -0,0 +1,53 @@
+//-----------------------------------------------------------------------
+// <copyright file="ServiceProviderEndpoint.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOAuth {
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Text;
+ using DotNetOAuth.Messaging;
+
+ /// <summary>
+ /// A description of an individual endpoint on a Service Provider.
+ /// </summary>
+ public class ServiceProviderEndpoint {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ServiceProviderEndpoint"/> class.
+ /// </summary>
+ /// <param name="locationUri">The URL of this Service Provider endpoint.</param>
+ /// <param name="method">The HTTP method(s) allowed.</param>
+ public ServiceProviderEndpoint(string locationUri, HttpDeliveryMethod method)
+ : this(new Uri(locationUri), method) { }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ServiceProviderEndpoint"/> class.
+ /// </summary>
+ /// <param name="location">The URL of this Service Provider endpoint.</param>
+ /// <param name="method">The HTTP method(s) allowed.</param>
+ public ServiceProviderEndpoint(Uri location, HttpDeliveryMethod method) {
+ if (location == null) {
+ throw new ArgumentNullException("location");
+ }
+ if (method == HttpDeliveryMethod.None) {
+ throw new ArgumentOutOfRangeException("method");
+ }
+
+ this.Location = location;
+ this.AllowedMethods = method;
+ }
+
+ /// <summary>
+ /// Gets or sets the URL of this Service Provider endpoint.
+ /// </summary>
+ public Uri Location { get; set; }
+
+ /// <summary>
+ /// Gets or sets the HTTP method(s) allowed.
+ /// </summary>
+ public HttpDeliveryMethod AllowedMethods { get; set; }
+ }
+}