Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client url verification and unsubscribe #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

client url verification and unsubscribe #7

wants to merge 3 commits into from

Conversation

brettesler-ext
Copy link

match specification query parameters for the client url verification call

ORIDASHI-SERVER\brett added 3 commits May 13, 2018 01:39
Copy link
Collaborator

@lbergnehr lbergnehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

It would be great if you could provide some more information in the PR on why you think it's needed: what you're changes are on a high-level, whey they're needed etc.

Moreover, when you've done changes, please rebase on the current master; that makes the history easier to read and we don't get a huge merge-bubble.

Thanks!

@@ -179,14 +194,14 @@ public IActionResult Post(string subscriptionId, [FromBody] Notification notific
return View("FHIRcastClient", internalModel);
}

[Route("unsubscribe/{subscriptionId}")]
[Route("Unsubscribe/{subscriptionId}")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this suggestion correct? Routes are generally lower-case and I think we should stick to that convention (even if it doesn't matter, technically).

@@ -62,8 +62,8 @@ public class SubscriptionVerification : SubscriptionWithLease {
}

public enum SubscriptionMode {
Subscribe,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should change the Enum casing just to get an easy fix for ToString() being the correct case. Better to stick with the language convention here.

@@ -87,21 +87,36 @@ public IActionResult Post([FromForm] ClientModel model)
/// <param name="verification">Hub's verification response to our subscription attempt</param>
/// <returns></returns>
[HttpGet("{subscriptionId}")]
public IActionResult Get(string subscriptionId, [FromQuery] SubscriptionVerification verification)
public IActionResult Get(string subscriptionId)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you see how validation is done when posting subscriptions? The validation is basically set on the model using attributes specifying what is required etc. The framework then generates error messages that can be used in the response (which should probably be Bad request and not Not found).

callbackParameters.Mode = subscription.Mode;
callbackParameters.Topic = subscription.Topic;
logger.LogDebug($"Calling callback url: {subscription.Callback}");
string verifyUrl = subscription.Callback + "?" +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You moved the logic for constructing the URL from the SubscriptionCallback class and in here. Keep it in that class instead if you need to re-write it. A better commit message on why you're doing this re-write would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants