Skip to content

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!

}

[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).

}

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.

/// <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