Added service interface for data import/export service and modified AuthenticationHolderEntity and Repository to allow getting all objects
parent
ec8f708472
commit
03f2d8f8a0
|
@ -33,6 +33,7 @@ import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
|||
@Entity
|
||||
@Table(name = "authentication_holder")
|
||||
@NamedQueries ({
|
||||
@NamedQuery(name = "AuthenticationHolderEntity.getAll", query = "select a from AuthenticationHolderEntity a"),
|
||||
@NamedQuery(name = "AuthenticationHolderEntity.getByAuthentication", query = "select a from AuthenticationHolderEntity a where a.authentication = :authentication"),
|
||||
@NamedQuery(name = "AuthenticationHolderEntity.getUnusedAuthenticationHolders", query = "select a from AuthenticationHolderEntity a where a.id not in (select t.authenticationHolder.id from OAuth2AccessTokenEntity t) and a.id not in (select r.authenticationHolder.id from OAuth2RefreshTokenEntity r)")
|
||||
})
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.mitre.oauth2.model.AuthenticationHolderEntity;
|
|||
import org.springframework.security.oauth2.provider.OAuth2Authentication;
|
||||
|
||||
public interface AuthenticationHolderRepository {
|
||||
public List<AuthenticationHolderEntity> getAll();
|
||||
|
||||
public AuthenticationHolderEntity getById(Long id);
|
||||
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
/*******************************************************************************
|
||||
* Copyright 2014 The MITRE Corporation
|
||||
* and the MIT Kerberos and Internet Trust Consortium
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
package org.mitre.openid.connect.service;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
* @author arielak
|
||||
*/
|
||||
public interface MITREidDataService {
|
||||
|
||||
/**
|
||||
* Data member for 1.0 configuration
|
||||
*/
|
||||
public static final String MITREID_CONNECT_1_0 = "mitreid-connect-1.0";
|
||||
public static final String MITREID_CONNECT_1_1 = "mitreid-connect-1.1";
|
||||
|
||||
// member names
|
||||
public static final String REFRESHTOKENS = "refreshTokens";
|
||||
public static final String ACCESSTOKENS = "accessTokens";
|
||||
public static final String AUTHENTICATIONHOLDERS = "authenticationHolders";
|
||||
public static final String GRANTS = "grants";
|
||||
public static final String CLIENTS = "clients";
|
||||
public static final String SYSTEMSCOPES = "systemScopes";
|
||||
|
||||
/**
|
||||
* Write out the current server state to the given JSON writer as a JSON object
|
||||
*
|
||||
* @param writer
|
||||
* @throws IOException
|
||||
*/
|
||||
void exportData(JsonWriter writer) throws IOException;
|
||||
|
||||
/**
|
||||
* Read in the current server state from the given JSON reader as a JSON object
|
||||
*
|
||||
* @param reader
|
||||
*/
|
||||
void importData(JsonReader reader) throws IOException;
|
||||
|
||||
}
|
Loading…
Reference in New Issue