mirror of
https://github.com/google/nomulus.git
synced 2025-05-28 09:50:57 +02:00
Use AuthenticatedRegistrarAccessor in EppConsoleAction
EppConsoleAction still "manually" checks access by going over the RegistrarContacts. We need it to use AuthenticatedRegistrarAccessor just like every other part of the registrar console. We still need to remove the (now unneeded) login EPP sent by the console, but that's left for a followup CL. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=222404208
This commit is contained in:
parent
eca3461dec
commit
5f283ebd09
15 changed files with 102 additions and 176 deletions
|
@ -14,10 +14,9 @@
|
|||
|
||||
package google.registry.flows;
|
||||
|
||||
import static com.google.appengine.api.users.UserServiceFactory.getUserService;
|
||||
|
||||
import com.google.common.collect.ImmutableSetMultimap;
|
||||
import google.registry.request.auth.AuthenticatedRegistrarAccessor;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.UserInfo;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
@ -31,18 +30,16 @@ public class EppLoginAdminUserTest extends EppTestCase {
|
|||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
.withDatastore()
|
||||
.withUserService(UserInfo.createAdmin("someone@example.com", "12345"))
|
||||
.build();
|
||||
|
||||
@Before
|
||||
public void initTransportCredentials() {
|
||||
setTransportCredentials(GaeUserCredentials.forCurrentUser(getUserService()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNonAuthedLogin_succeedsAsAdmin() throws Exception {
|
||||
// Login succeeds even though this user isn't listed on the registrar.
|
||||
assertThatLoginSucceeds("TheRegistrar", "password2");
|
||||
setTransportCredentials(
|
||||
new GaeUserCredentials(
|
||||
AuthenticatedRegistrarAccessor.createForTesting(
|
||||
ImmutableSetMultimap.of(
|
||||
"TheRegistrar", AuthenticatedRegistrarAccessor.Role.ADMIN,
|
||||
"NewRegistrar", AuthenticatedRegistrarAccessor.Role.ADMIN))));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue