Skip to content

Commit

Permalink
Removal of net.oauth dependency. Screenshot for Grails plugin wiki.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.codehaus.org/grails-plugins/grails-oauth/trunk@62667 832c1c66-4827-0410-8465-ccb17913cd09
  • Loading branch information
acampbell3000 committed Jul 3, 2010
1 parent 8215605 commit bb503e0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
9 changes: 4 additions & 5 deletions oauth-plugin/CHANGES.txt
@@ -1,14 +1,13 @@

Potential improvements:
- Wiki pages on how to use new scope config property.
- Wiki pages on how to fork and contibute etc.
- Removal of net.oauth dependency.
- README.txt file.
- Turn OAuth service into stateless session bean to improve performance.
--- Will need to stop storing auth URLs locally for controller.

Release notes 0.4 (TBA)
- Removal of net.oauth library dependency.

Release notes 0.3 (1st July 2010)
Release notes 0.3 (1st July, 2010)

- Update to Grails 1.3.2.
- Introduction to BuildConfig.groovy.
Expand All @@ -26,7 +25,7 @@ Release notes 0.1.1

- Patch for LinkedIn

Release notes 0.1
Release notes 0.1 (30th May, 2008)

- Initial release.

2 changes: 1 addition & 1 deletion oauth-plugin/grails-app/conf/BuildConfig.groovy
Expand Up @@ -13,7 +13,7 @@ grails.project.dependency.resolution = {
}

dependencies {
runtime 'net.oauth:oauth-core:20090531'
//runtime 'net.oauth:oauth-core:20090531'
runtime 'oauth.signpost:signpost-core:1.2'
}

Expand Down
Expand Up @@ -148,7 +148,7 @@ class OauthService implements InitializingBean {
* @param consumerName the consumer to fetch request token from.
* @return A map containing the token key, secret and authorisation URL.
*/
def fetchRequestToken(consumerName) {
def fetchRequestToken(final def consumerName) {
log.debug "Fetching request token for ${consumerName}"

try {
Expand All @@ -165,7 +165,7 @@ class OauthService implements InitializingBean {
[key: consumer?.getToken(), secret: consumer?.getTokenSecret()]

} catch (Exception ex) {
final def errorMessage = "Unable to fetch request token: consumerName = $consumerName"
final def errorMessage = "Unable to fetch request token (consumerName=$consumerName)"

log.error(errorMessage, ex)
throw new OauthServiceException(errorMessage, ex)
Expand All @@ -182,7 +182,7 @@ class OauthService implements InitializingBean {
* @return The URL to redirect the user to for authorisation.
*/
@Deprecated
def getAuthUrl(key, consumerName, params) {
def getAuthUrl(final def key, final def consumerName, final def params) {
log.debug "Fetching authorisation URL for $consumerName"

authUrls[consumerName]
Expand All @@ -193,7 +193,7 @@ class OauthService implements InitializingBean {
*
* @return A map containing the access token and secret.
*/
def fetchAccessToken(consumerName, requestToken) {
def fetchAccessToken(final def consumerName, final def requestToken) {
log.debug "Going to exchange for access token"

try {
Expand Down Expand Up @@ -239,7 +239,9 @@ class OauthService implements InitializingBean {
* @param params any request parameters.
* @return the response from the server.
*/
def accessResource(url, consumer, token, method = 'GET', params = null) {
def accessResource(final def url, final def consumer, final def token,
final def method = 'GET', final def params = null) {

accessResource(url: url, consumer: consumer, token: token, method: method, params: params)
}

Expand All @@ -249,7 +251,7 @@ class OauthService implements InitializingBean {
* @param args access resource arguments.
* @return the response from the server.
*/
def accessResource(Map args) {
def accessResource(final def Map args) {
log.debug "Attempt to access protected resource"

// Declare request parameters
Expand Down Expand Up @@ -325,7 +327,7 @@ class OauthService implements InitializingBean {
* @param consumerName the consumer name.
* @return the consumer instance by name.
*/
def getConsumer(consumerName) {
def getConsumer(final def consumerName) {
consumers[consumerName]
}

Expand All @@ -335,7 +337,7 @@ class OauthService implements InitializingBean {
* @param consumerName the consumer name.
* @return the provider instance by name.
*/
def getProvider(consumerName) {
def getProvider(final def consumerName) {
providers[consumerName]
}

Expand All @@ -345,7 +347,7 @@ class OauthService implements InitializingBean {
* @param consumerName the consumer name.
* @return the authorisational URL instance by consumer name.
*/
def getAuthUrl(consumerName) {
def getAuthUrl(final def consumerName) {
log.debug "Fetching authorisation URL for $consumerName"

authUrls[consumerName]
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bb503e0

Please sign in to comment.