feat: Implement "accept list" authorization handlers for "Follow" and "Invite" witness #867
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.
Implemented "accept list" authorization policies for "Follow" and "Invite" witness ActivityPub requests. When one of these ActivityPub requests is sent to an Orb server, the server uses an authorization policy that is configured either as "accept-all" (default) or "accept-list". The "accept-all" policy accepts any "Follow" or "Invite" witness request (i.e. an ActivityPub response of "Accept" is always returned). The "accept-list" policy only accepts a "Follow" or "Invite" witness request IF the actor of the request is included in an "accept list" of the destination server. So, if the actor of the request is NOT in the accept list, then a "Reject" activity is returned to the requestor.
The "accept list" is managed by a new REST endpoint: /services/orb/acceptlist. A POST request updates the accept list to add or remove actor URIs, and a GET request retrieves the current accept list. The GET request may include a parameter, "type" (e.g. "follow", "invite-witness") so that only the URIs of the given type are returned. If no "type" parameter is specified then accept lists of all types are returned.
This commit also reduces the number of DEBUG logs that are emitted.
closes #352
closes #353
Signed-off-by: Bob Stasyszyn Bob.Stasyszyn@securekey.com