Secured admin client for control panel
This commit is contained in:
parent
6cb1b91e05
commit
11ef2b51c9
@ -7,6 +7,7 @@ import ru.dragonestia.picker.api.impl.RoomPickerClient;
|
||||
import ru.dragonestia.picker.cp.annotation.ServerURL;
|
||||
import ru.dragonestia.picker.cp.model.Account;
|
||||
import ru.dragonestia.picker.cp.model.provider.AccountProvider;
|
||||
import ru.dragonestia.picker.cp.util.AdminRoomPickerClient;
|
||||
|
||||
@Configuration
|
||||
public class RoomPickerConfig {
|
||||
@ -28,7 +29,7 @@ public class RoomPickerConfig {
|
||||
|
||||
@Bean
|
||||
RoomPickerClient adminClient() {
|
||||
return new RoomPickerClient(serverUrl, "admin", "qwerty123");
|
||||
return new AdminRoomPickerClient(serverUrl, adminUsername, adminPassword);
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
package ru.dragonestia.picker.cp.util;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import ru.dragonestia.picker.api.impl.RoomPickerClient;
|
||||
import ru.dragonestia.picker.api.repository.NodeRepository;
|
||||
import ru.dragonestia.picker.api.repository.RoomRepository;
|
||||
import ru.dragonestia.picker.api.repository.UserRepository;
|
||||
|
||||
public class AdminRoomPickerClient extends RoomPickerClient {
|
||||
|
||||
public AdminRoomPickerClient(@NotNull String url, @NotNull String username, @NotNull String password) {
|
||||
super(url, username, password);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull NodeRepository getNodeRepository() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull RoomRepository getRoomRepository() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull UserRepository getUserRepository() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user