backend fixes
This commit is contained in:
parent
d983e1e38e
commit
e4203a3bb4
|
@ -87,11 +87,13 @@ public class SectionEntity implements XmlSerializable<SectionEntity> {
|
|||
systemFields.appendChild(systemField.toXml(doc));
|
||||
}
|
||||
rootElement.appendChild(systemFields);
|
||||
Element descriptionTemplates = doc.createElement("descriptionTemplates");
|
||||
for (DescriptionTemplateEntity descriptionTemplate : this.descriptionTemplates) {
|
||||
descriptionTemplates.appendChild(descriptionTemplate.toXml(doc));
|
||||
if (this.descriptionTemplates != null) {
|
||||
Element descriptionTemplates = doc.createElement("descriptionTemplates");
|
||||
for (DescriptionTemplateEntity descriptionTemplate : this.descriptionTemplates) {
|
||||
descriptionTemplates.appendChild(descriptionTemplate.toXml(doc));
|
||||
}
|
||||
rootElement.appendChild(descriptionTemplates);
|
||||
}
|
||||
rootElement.appendChild(descriptionTemplates);
|
||||
temp = this.fields.stream().filter(f -> f.getCategory().equals(DmpBlueprintFieldCategory.Extra)).collect(Collectors.toList());
|
||||
List<ExtraFieldEntity> extraFieldList = temp.stream().map(x-> (ExtraFieldEntity)x).collect(Collectors.toList());
|
||||
Element extraFields = doc.createElement("extraFields");
|
||||
|
|
|
@ -36,19 +36,19 @@ public class DepositConfiguration {
|
|||
public List<RepositoryDeposit> depositClients() {
|
||||
List<RepositoryDeposit> clients = new ArrayList<>();
|
||||
for (DepositProperties.DepositSource source: properties.getSources()) {
|
||||
ClientRegistration clientRegistration = ClientRegistration
|
||||
.withRegistrationId(source.getClientId())
|
||||
.clientId(source.getClientId())
|
||||
.clientSecret(source.getClientSecret())
|
||||
.scope(source.getScope())
|
||||
.issuerUri(source.getIssuerUrl())
|
||||
.authorizationGrantType(AuthorizationGrantType.JWT_BEARER)
|
||||
.build();
|
||||
ReactiveClientRegistrationRepository clientRegistrationRepository = new InMemoryReactiveClientRegistrationRepository(clientRegistration);
|
||||
ReactiveOAuth2AuthorizedClientService clientService = new InMemoryReactiveOAuth2AuthorizedClientService(clientRegistrationRepository);
|
||||
AuthorizedClientServiceReactiveOAuth2AuthorizedClientManager authorizedClientManager = new AuthorizedClientServiceReactiveOAuth2AuthorizedClientManager(clientRegistrationRepository, clientService);
|
||||
ServerOAuth2AuthorizedClientExchangeFilterFunction oauth = new ServerOAuth2AuthorizedClientExchangeFilterFunction(authorizedClientManager);
|
||||
clients.add(new DepositRepository(WebClient.builder().baseUrl(source.getUrl() + "/api/deposit").filters(exchangeFilterFunctions -> exchangeFilterFunctions.add(oauth)).build()));
|
||||
// ClientRegistration clientRegistration = ClientRegistration
|
||||
// .withRegistrationId(source.getClientId())
|
||||
// .clientId(source.getClientId())
|
||||
// .clientSecret(source.getClientSecret())
|
||||
// .scope(source.getScope())
|
||||
// .issuerUri(source.getIssuerUrl())
|
||||
// .authorizationGrantType(AuthorizationGrantType.JWT_BEARER)
|
||||
// .build();
|
||||
// ReactiveClientRegistrationRepository clientRegistrationRepository = new InMemoryReactiveClientRegistrationRepository(clientRegistration);
|
||||
// ReactiveOAuth2AuthorizedClientService clientService = new InMemoryReactiveOAuth2AuthorizedClientService(clientRegistrationRepository);
|
||||
// AuthorizedClientServiceReactiveOAuth2AuthorizedClientManager authorizedClientManager = new AuthorizedClientServiceReactiveOAuth2AuthorizedClientManager(clientRegistrationRepository, clientService);
|
||||
// ServerOAuth2AuthorizedClientExchangeFilterFunction oauth = new ServerOAuth2AuthorizedClientExchangeFilterFunction(authorizedClientManager);
|
||||
// clients.add(new DepositRepository(WebClient.builder().baseUrl(source.getUrl() + "/api/deposit").filters(exchangeFilterFunctions -> exchangeFilterFunctions.add(oauth)).build()));
|
||||
}
|
||||
return clients;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,8 @@ import java.util.UUID;
|
|||
@JsonTypeInfo(
|
||||
use = JsonTypeInfo.Id.NAME,
|
||||
include = JsonTypeInfo.As.PROPERTY,
|
||||
property = "category")
|
||||
property = "category",
|
||||
visible = true)
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = SystemFieldPersist.class, name = "0"),
|
||||
@JsonSubTypes.Type(value = ExtraFieldPersist.class, name = "1")
|
||||
|
|
Loading…
Reference in New Issue