ClientAPI cleanup
parent
f91071c350
commit
a4fc4e939e
|
@ -20,8 +20,7 @@ import org.mitre.oauth2.service.ClientDetailsEntityService;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.Collection;
|
||||
|
@ -45,7 +44,7 @@ public class ClientAPI {
|
|||
}
|
||||
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@RequestMapping("")
|
||||
@RequestMapping(method = RequestMethod.GET, headers="application/json")
|
||||
public ModelAndView apiGetAllClients(ModelAndView modelAndView) {
|
||||
|
||||
Collection<ClientDetailsEntity> clients = clientService.getAllClients();
|
||||
|
@ -55,94 +54,11 @@ public class ClientAPI {
|
|||
return modelAndView;
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* @param modelAndView
|
||||
* @param clientId
|
||||
* @param clientSecret
|
||||
* @param scope
|
||||
* @param grantTypes
|
||||
* @param redirectUri
|
||||
* @param authorities
|
||||
* @param name
|
||||
* @param description
|
||||
* @param allowRefresh
|
||||
* @param accessTokenTimeout
|
||||
* @param refreshTokenTimeout
|
||||
* @param owner
|
||||
* @return
|
||||
*//*
|
||||
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@RequestMapping("/add")
|
||||
public ModelAndView apiAddClient(ModelAndView modelAndView,
|
||||
@RequestParam String clientId, @RequestParam String clientSecret,
|
||||
@RequestParam String scope, // space delimited
|
||||
@RequestParam String grantTypes, // space delimited
|
||||
@RequestParam(required = false) String redirectUri,
|
||||
@RequestParam String authorities, // space delimited
|
||||
@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String description,
|
||||
@RequestParam(required = false, defaultValue = "false") boolean allowRefresh,
|
||||
@RequestParam(required = false) Long accessTokenTimeout,
|
||||
@RequestParam(required = false) Long refreshTokenTimeout,
|
||||
@RequestParam(required = false) String owner
|
||||
) {
|
||||
@RequestMapping(method = RequestMethod.POST, headers="application/json")
|
||||
@ResponseBody
|
||||
public ClientDetailsEntity addClient(@RequestBody ClientDetailsEntity c) {
|
||||
/*ClientDetailsEntity created = clientService.createClient()
|
||||
return created;*/
|
||||
return null;
|
||||
}
|
||||
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* @param modelAndView
|
||||
* @param clientId
|
||||
* @return
|
||||
*//*
|
||||
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@RequestMapping("/delete")
|
||||
public ModelAndView apiDeleteClient(ModelAndView modelAndView,
|
||||
@RequestParam String clientId) {
|
||||
return null;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* *//**
|
||||
*
|
||||
* @param modelAndView
|
||||
* @param clientId
|
||||
* @param clientSecret
|
||||
* @param scope
|
||||
* @param grantTypes
|
||||
* @param redirectUri
|
||||
* @param authorities
|
||||
* @param name
|
||||
* @param description
|
||||
* @param allowRefresh
|
||||
* @param accessTokenTimeout
|
||||
* @param refreshTokenTimeout
|
||||
* @param owner
|
||||
* @return
|
||||
*//*
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
@RequestMapping("/update")
|
||||
public ModelAndView apiUpdateClient(ModelAndView modelAndView,
|
||||
@RequestParam String clientId, @RequestParam String clientSecret,
|
||||
@RequestParam String scope, // space delimited
|
||||
@RequestParam String grantTypes, // space delimited
|
||||
@RequestParam(required = false) String redirectUri,
|
||||
@RequestParam String authorities, // space delimited
|
||||
@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) String description,
|
||||
@RequestParam(required = false, defaultValue = "false") boolean allowRefresh,
|
||||
@RequestParam(required = false) Long accessTokenTimeout,
|
||||
@RequestParam(required = false) Long refreshTokenTimeout,
|
||||
@RequestParam(required = false) String owner
|
||||
) {
|
||||
return null;
|
||||
}*/
|
||||
}
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
refreshTokens:false
|
||||
},
|
||||
|
||||
urlRoot:"/resources/test/json/clients.js"
|
||||
urlRoot:"/api/clients"
|
||||
|
||||
});
|
||||
|
||||
var ClientCollection = Backbone.Collection.extend({
|
||||
model:ClientModel,
|
||||
url:"/resources/test/json/clients.js"
|
||||
url:"/api/clients"
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue