Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump io.dropwizard:dropwizard-dependencies from 2.1.1 to 4.0.6 #3284

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
67e95b2
Bump io.dropwizard:dropwizard-dependencies from 2.1.1 to 4.0.6
dependabot[bot] Jan 31, 2024
de9d875
migrate to new bom deps
awildturtok Mar 11, 2024
50231e8
brute force first impl to make DefaultAuthFilter work. RedirectingAut…
awildturtok Mar 13, 2024
727f414
cleanup TestLoggingFactory, strip of seemingly useless code
awildturtok Mar 13, 2024
c2b62ba
intermediate changes to make properly inject multiple TokenExtractor
awildturtok Mar 14, 2024
442017a
remove conflicting settings of default metrics registry
thoniTUB Mar 18, 2024
02fb6c1
ignore fields from throwable in serdes
thoniTUB Mar 18, 2024
98f7753
Merge branch 'develop' into dependabot/maven/io.dropwizard-dropwizard…
thoniTUB Mar 18, 2024
bcf7ada
remove Feature interface from AuthFilter
thoniTUB Mar 18, 2024
ba937db
wip make cypress tests pass
thoniTUB Mar 18, 2024
8380f3c
make cypress tests pass
thoniTUB Mar 19, 2024
af04d99
dev realm register token extractor only if admin servlet is present
thoniTUB Mar 19, 2024
31e54d4
Merge branch 'develop' into dependabot/maven/io.dropwizard-dropwizard…
thoniTUB Mar 19, 2024
0ee6519
make auth cookie filter stateless
thoniTUB Mar 19, 2024
8885f91
review changes
thoniTUB Mar 21, 2024
84154b9
remove obsolete injection annotation
thoniTUB Mar 21, 2024
dd583e7
fix admin ui login injection
thoniTUB Mar 21, 2024
b689e4d
fix injection of delegate auth filter
thoniTUB Mar 21, 2024
df631de
clean up auth filter registration
thoniTUB Mar 21, 2024
2e1b221
Merge branch 'develop' into dependabot/maven/io.dropwizard-dropwizard…
awildturtok Mar 28, 2024
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
@@ -1,10 +1,11 @@
package com.bakdata.conquery.models.auth.web;

import java.io.IOException;
import java.util.function.BiFunction;

import com.bakdata.conquery.models.config.ConqueryConfig;
import com.google.common.base.Strings;
import jakarta.annotation.Priority;
import jakarta.inject.Inject;
import jakarta.ws.rs.Priorities;
import jakarta.ws.rs.container.ContainerRequestContext;
import jakarta.ws.rs.container.ContainerRequestFilter;
Expand All @@ -30,12 +31,13 @@
@PreMatching
// Chain this filter before the Authentication filter
@Priority(Priorities.AUTHENTICATION-100)
@RequiredArgsConstructor
@RequiredArgsConstructor(onConstructor_ = {@Inject})
public class AuthCookieFilter implements ContainerRequestFilter, ContainerResponseFilter {

public static final String ACCESS_TOKEN = "access_token";
private static final String PREFIX = "bearer";
public final BiFunction<ContainerRequestContext, String, Cookie> cookieCreator;

private final ConqueryConfig config;

/**
* The filter tries to extract a token from a cookie and puts it into the
Expand Down Expand Up @@ -81,7 +83,7 @@ public void filter(ContainerRequestContext request, ContainerResponseContext res
}
response.getHeaders().add(
HttpHeader.SET_COOKIE.toString(),
cookieCreator.apply(request,token)
config.getAuthentication().createAuthCookie(request, token)
);

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.bakdata.conquery.models.config.auth;

import java.util.concurrent.atomic.AtomicReference;

import com.bakdata.conquery.models.auth.web.AuthCookieFilter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.dropwizard.util.Duration;
import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.container.ContainerRequestContext;
Expand All @@ -19,11 +16,6 @@ public class AuthenticationConfig {
@NotNull
private Duration adminEndCookieDuration = Duration.hours(1);

@JsonIgnore
private AtomicReference<AuthCookieFilter> authCookieFilter = new AtomicReference<>();




public NewCookie createAuthCookie(ContainerRequestContext request, String token) {
return new NewCookie(
Expand Down Expand Up @@ -52,10 +44,4 @@ public static NewCookie expireCookie(String cookieName) {
);
}

@JsonIgnore
public AuthCookieFilter getAuthCookieFilter() {
return authCookieFilter.updateAndGet(
(f) -> f != null ? f : new AuthCookieFilter(this::createAuthCookie)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ public AdminServlet(ManagerNode manager) {
manager.getStorageListener()
);

final AuthCookieFilter authCookieFilter = manager.getConfig().getAuthentication().getAuthCookieFilter();

jerseyConfig.register(new AbstractBinder() {
@Override
protected void configure() {
Expand All @@ -122,7 +120,7 @@ protected void configure() {
.register(IdRefPathParamConverterProvider.class)
.register(new MultiPartFeature())
.register(IdParamConverter.Provider.INSTANCE)
.register(authCookieFilter);
.register(AuthCookieFilter.class);


jerseyConfigUI.register(new ViewMessageBodyWriter(manager.getEnvironment().metrics(), Collections.singleton(Freemarker.HTML_RENDERER)))
Expand All @@ -133,12 +131,13 @@ protected void configure() {
bindAsContract(UIProcessor.class);
bind(manager.getDatasetRegistry()).to(DatasetRegistry.class);
bind(manager.getStorage()).to(MetaStorage.class);
bind(manager.getConfig()).to(ConqueryConfig.class);
}
})
.register(AdminPermissionFilter.class)
.register(IdRefPathParamConverterProvider.class)
.register(authCookieFilter);
;
.register(AuthCookieFilter.class);

}

public void register() {
Expand Down
Loading