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

[WIP] Tasklist Single Application #18474

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

romansmirnov
Copy link
Member

Description

Related issues

closes #

@github-actions github-actions bot added component/zeebe Related to the Zeebe component/team component/operate Related to the Operate component/team component/tasklist Related to the Tasklist component/team labels May 13, 2024
@romansmirnov romansmirnov changed the base branch from main to rs-ope-zb-single-application May 13, 2024 19:15
@romansmirnov romansmirnov changed the title Rs tasklist single application [WIP] Tasklist Single Application May 13, 2024
Comment on lines +31 to +33
return http.securityMatcher("/v1/topology", "/v1/user-tasks/**")
.csrf()
.disable()

Check failure

Code scanning / CodeQL

Disabled Spring CSRF protection High

CSRF vulnerability due to protection being disabled.
}

private static HttpSecurity configureSecurity(final HttpSecurity http) throws Exception {
return http.csrf(CsrfConfigurer::disable)

Check failure

Code scanning / CodeQL

Disabled Spring CSRF protection High

CSRF vulnerability due to protection being disabled.
Copy link
Collaborator

@houssain-barouni houssain-barouni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just taking notes about the subjects to discuss with Roman

@@ -114,6 +124,8 @@ camunda:
url: http://localhost:9200
# Index prefix, configured in Zeebe Elasticsearch exporter
prefix: zeebe-record
importer:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this used?

@@ -30,7 +30,7 @@ public void initialize(ConfigurableApplicationContext context) {
}

protected boolean shouldApplyDefaultAuthenticationProfile(final Set<String> activeProfiles) {
if (activeProfiles.contains(Profile.OPERATE.getId())) {
if (activeProfiles.contains(Profile.OPERATE.getId()) || activeProfiles.contains(Profile.TASKLIST.getId())) {
return OperateProfileService.AUTH_PROFILES.stream().noneMatch(activeProfiles::contains);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to centralize auth profiles in a single place

@@ -62,14 +63,19 @@ public void initialize(final ConfigurableApplicationContext context) {
}

protected boolean shouldEnableProbes(final List<String> activeProfiles) {
return activeProfiles.stream().anyMatch(p -> p.equalsIgnoreCase(Profile.OPERATE.getId()));
return activeProfiles.stream()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can define Profile settings. to avoid doing if profile == Operate or profile == Tasklist in multiple places

public class TasklistModuleConfiguration {

// if present, then it will ensure
// that the broker is started first
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have Broker and Gateway beans ?

.anonymous(AnonymousConfigurer::disable);
}

@Profile("auth")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed. It is defined at class level


@GetMapping("/index.html")
public String index() {
return "redirect:/operate";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should check if Tasklist standalone mode is used, in such case we need to redirect to /tasklist

@@ -6,7 +6,7 @@ spring.web.resources.static-locations=classpath:/META-INF/resources/operate/

# configure thymeleaf used by index.html
spring.thymeleaf.check-template-location=true
spring.thymeleaf.prefix=classpath:/META-INF/resources/operate/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does this impact Tasklist parameter ?

@@ -31,6 +32,7 @@

@Component
@RestControllerEndpoint(id = "backups")
@Profile("standalone")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rather use @RestControllerEndpoint(id = "tasklist/backups") to be able to create backups with the single application?

@@ -14,12 +14,14 @@
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.endpoint.web.annotation.RestControllerEndpoint;
import org.springframework.context.annotation.Profile;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

@Component
@RestControllerEndpoint(id = "usage-metrics")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@@ -46,7 +46,7 @@ public class ClientConfig {
@Value("${CAMUNDA_TASKLIST_IDENTITY_USER_ACCESS_RESTRICTIONS_ENABLED:#{true}}")
public boolean isUserAccessRestrictionsEnabled;

@Autowired private TasklistProfileService profileService;
// @Autowired private TasklistProfileService profileService;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fixed

Base automatically changed from rs-ope-zb-single-application to main May 16, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/operate Related to the Operate component/team component/tasklist Related to the Tasklist component/team component/zeebe Related to the Zeebe component/team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants