forked from andregasser/bigbone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update scopes used in OAuth (andregasser#382)
* Update scopes used in OAuth - makes all scope parameters in OAuth and App methods optional. Endpoints not receiving a scope parameter will default to granting "read" permission. - removes default parameter value from Scope constructor. Users will need to define a certain scope if they want to use it. Closes andregasser#116. - adds all scopes as defined by Mastodon, marks existing scopes FOLLOW and ALL as deprecated. - removes all internal usage of the now deprecated ALL scope. Closes andregasser#143. - moves deduplication of scopes from a separate function into the one building the parameter string. This avoids unnecessarily throwing an IllegalArgumentException. Closes andregasser#381. * Enhance Scope usage in tests - in integration tests, declare "full scope" once - in unit tests, do not specify any Scope unless directly tested - remove deprecated "follow" scope from the access token asset * In samples to get access token, ensure that scopes requested for the token match those in OAuth URL. * Enable hierarchical access to defined scopes - replace Name enum with hierarchical structure for a more intuitive access to individual scopes - changing samples and USAGE.md to match Examples: - Scope(Scope.Name.READ) becomes Scope(Scope.READ.ALL) - Scope(Scope.Name.ADMIN_READ_ACCOUNTS) becomes Scope(Scope.ADMIN.READ.ACCOUNTS) --------- Co-authored-by: Patrick Geselbracht <[email protected]>
- Loading branch information
1 parent
f14e7fd
commit 3bc604d
Showing
20 changed files
with
275 additions
and
83 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package social.bigbone | ||
|
||
import social.bigbone.api.Scope | ||
|
||
class TestConstants { | ||
companion object { | ||
const val REST_API_HOSTNAME = "localhost" | ||
|
@@ -15,5 +17,7 @@ class TestConstants { | |
const val USER2_USERNAME = "user2" | ||
const val USER2_EMAIL = "[email protected]" | ||
const val USER2_PASSWORD = "user2abcdef" | ||
|
||
val fullScope = Scope(Scope.READ.ALL, Scope.WRITE.ALL, Scope.PUSH.ALL) | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.