Commit 25f25188 authored by Viacheslav Pavlov's avatar Viacheslav Pavlov

added listClientDetails by Page, fixed Json for OAuthClient#scopes

removed unnecessary JsonProperty annotation usage
parent 431f9c7e
......@@ -38,6 +38,7 @@ import javax.persistence.PreUpdate;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.StringUtils;
import org.genesys.blocks.model.Copyable;
import org.genesys.blocks.model.JsonViews;
......@@ -416,6 +417,7 @@ public class OAuthClient extends AclSid implements ClientDetails, Copyable<OAuth
* (non-Javadoc)
* @see org.springframework.security.oauth2.provider.ClientDetails#getScope()
*/
@JsonProperty("clientScopes")
@Override
public Set<String> getScope() {
return scopes;
......@@ -426,6 +428,7 @@ public class OAuthClient extends AclSid implements ClientDetails, Copyable<OAuth
*
* @param scopes the new scopes
*/
@JsonProperty("clientScopes")
public void setScopes(Set<String> scopes) {
this.scopes = scopes;
}
......
......@@ -18,6 +18,8 @@ package org.genesys.blocks.oauth.service;
import java.util.List;
import org.genesys.blocks.oauth.model.OAuthClient;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.security.oauth2.provider.ClientDetailsService;
/**
......@@ -32,6 +34,13 @@ public interface OAuthClientDetailsService extends ClientDetailsService {
*/
List<OAuthClient> listClientDetails();
/**
* List client details.
*
* @return page with Client details
*/
Page<OAuthClient> listClientDetails(Pageable pageable);
/**
* Gets the client.
*
......
......@@ -40,7 +40,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.crypto.password.PasswordEncoder;
......@@ -558,6 +560,11 @@ public class OAuthServiceImpl implements OAuthClientDetailsService, OAuthTokenSt
return oauthClientRepository.findAll(new Sort("clientId"));
}
@Override
public Page<OAuthClient> listClientDetails(Pageable pageable) {
return oauthClientRepository.findAll(pageable);
}
/*
* (non-Javadoc)
* @see org.genesys.blocks.oauth.service.OAuthTokenStoreService#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment