Repository navigation
Adding ContextTeamId and ContextEnterpriseId to EventCallback, and IsEnterpriseInstall to Authorization - #272
Merged
Conversation
…EnterpriseInstall to Authorization
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three fields in the Events API payload that Slack sends with events have no property in SlackNet 0.19.0. Unlike the fields inside an event, they have nowhere to land:
EventCallbackandAuthorizationhave no extension data, so a deserialized callback silently drops them. I found them comparing a real Events API delivery withEventCallback. My app doesn't read them through a workaround today. This models them. It is one commit.EventCallback.ContextTeamId(context_team_id) andContextEnterpriseId(context_enterprise_id), next toTeamIdandEnterpriseId. The reference describes the second as "The enterprise org through which your app is receiving the event (i.e., where the app is installed).", andContextTeamIdhas the workspace version of that sentence.Authorization.IsEnterpriseInstall(is_enterprise_install), on each entry ofauthorizations.oauth.v2.accesshas the same flag, and its page says to look for it "to determine whether it has been installed on an entire organization or a single workspace", which is the wording I used.Compatibility
Additive only. The new properties default to null and false.
Testing
New
EventCallbackTests: a callback with both context IDs, one with a nullcontext_enterprise_id, and authorizations withis_enterprise_installtrue and false../do testpasses (786 tests).Seen in a real response: all three are in a real Events API delivery.
Not verified: the wording. The reference describes
context_enterprise_idin its field table, but showscontext_team_idandis_enterprise_installonly in its example payloads, so those two doc comments are my reading of them. I also haven't run my app against a local pack of this branch.