Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public class Engagement extends PanacheMongoEntityBase {
*/
public EngagementState getEngagementCurrentState(LocalDateTime currentDate) {

if (launch == null || endDate == null || startDate == null) { // not launched or irregularly launched
if (launch == null || endDate == null || startDate == null) { // not launched o irregularly launched
return EngagementState.UPCOMING;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.redhat.labs.lodestar.rest.client;

import javax.ws.rs.core.MultivaluedMap;

import org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory;
import org.jboss.resteasy.specimpl.MultivaluedMapImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class JWTRequestFactory implements ClientHeadersFactory {
private static final Logger LOGGER = LoggerFactory.getLogger(JWTRequestFactory.class);


@Override
public MultivaluedMap<String, String> update(MultivaluedMap<String, String> incomingHeaders,
MultivaluedMap<String, String> clientOutgoingHeaders) {

if(LOGGER.isTraceEnabled()) {
incomingHeaders.entrySet().forEach(e -> {
LOGGER.trace(String.format("Header %s Value %s", e.getKey(), e.getValue()));
});
}

MultivaluedMap<String, String> result = new MultivaluedMapImpl<String, String>();
result.add("Authorization", incomingHeaders.getFirst("Authorization"));

return result;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;

import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders;
import org.eclipse.microprofile.rest.client.annotation.RegisterProvider;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

Expand All @@ -15,6 +16,7 @@
@ApplicationScoped
@RegisterRestClient(configKey = "lodestar.config.api")
@RegisterProvider(value = LodeStarGitLabAPIServiceResponseMapper.class, priority = 50)
@RegisterClientHeaders(JWTRequestFactory.class)
public interface LodeStarConfigApiClient {

@GET
Expand Down