Moved scope inside OAuthConfig
This commit is contained in:
1 parent
41b6da1a44
commit
109c93b4e4
11 files changed
+32
-76
No files matched your search
@@ -147,6 +147,6 @@ public class ServiceBuilder
|
||||
Preconditions.checkNotNull(api, "You must specify a valid api through the provider() method");
|
||||
Preconditions.checkEmptyString(apiKey, "You must provide an api key");
|
||||
Preconditions.checkEmptyString(apiSecret, "You must provide an api secret");
|
||||
return api.createService(new OAuthConfig(apiKey, apiSecret, callback, signatureType), scope);
|
||||
return api.createService(new OAuthConfig(apiKey, apiSecret, callback, signatureType, scope));
|
||||
}
|
||||
}
|
||||
@@ -21,5 +21,5 @@ public interface Api
|
||||
*
|
||||
* @return fully configured {@link OAuthService}
|
||||
*/
|
||||
OAuthService createService(OAuthConfig config, String scope);
|
||||
OAuthService createService(OAuthConfig config);
|
||||
}
|
||||
@@ -134,14 +134,7 @@ public abstract class DefaultApi10a implements Api
|
||||
* @param callback OAuth callback (either URL or 'oob')
|
||||
* @param scope OAuth scope (optional)
|
||||
*/
|
||||
public OAuthService createService(OAuthConfig config, String scope)
|
||||
{
|
||||
OAuthService service = doCreateService(config);
|
||||
service.addScope(scope);
|
||||
return service;
|
||||
}
|
||||
|
||||
private OAuthService doCreateService(OAuthConfig config)
|
||||
public OAuthService createService(OAuthConfig config)
|
||||
{
|
||||
return new OAuth10aServiceImpl(this, config);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public abstract class DefaultApi20 implements Api
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public OAuthService createService(OAuthConfig config, String scope)
|
||||
public OAuthService createService(OAuthConfig config)
|
||||
{
|
||||
return new OAuth20ServiceImpl(this, config);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user