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

Remove unsupported webhook fields #75

Merged
merged 6 commits into from
Dec 5, 2023

Conversation

jesperes
Copy link
Contributor

@jesperes jesperes commented Dec 5, 2023

The sslVerificationRequired and scopeType fields received from the GET .../webhooks API call are not supported by BEC right now. Remove them so they don't interfere with our tests.

rebar.config Show resolved Hide resolved
@@ -396,7 +396,7 @@ get_webhooks_pre(S) ->
get_webhooks_post(S, _Args, {ok, WebHooks0}) ->
Generated = [id, createdDate, updatedDate],
Webhooks = [lists:foldl(fun maps:remove/2, WH, Generated)|| WH <- WebHooks0],
?assertEqual(lists:sort(Webhooks), lists:sort(maps:get(webhooks, S))),
?assertEqual(lists:sort(maps:get(webhooks, S)), lists:sort(Webhooks)),
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To make the error message make more sense, since the left is the "expected" value and the right the "actual" value.

, <<"events">> => lists:sort(Events)
}).
Map0 = maps:remove(<<"sslVerificationRequired">>, Map),
Map1 = maps:remove(<<"scopeType">>, Map0),
Copy link
Member

Choose a reason for hiding this comment

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

I have a feeling this might come back and bite us in prod. And given BEC's lack of decent error messages it might be difficult to diagnose.

@jesperes jesperes removed the request for review from onno-vos-dev December 5, 2023 09:34
@jesperes jesperes merged commit 989ec10 into master Dec 5, 2023
5 checks passed
@jesperes jesperes deleted the remove-unsupported-webhook-fields branch December 5, 2023 09:34
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