forked from it-at-m/refarch-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Test action lint #16
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
Draft
hupling
wants to merge
25
commits into
main
Choose a base branch
from
test-action-lint
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Test action lint #16
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
dd34300
Update actionlint.yml
hupling 698308f
fix bug
hupling 53cfd6e
Update actionlint.yml
hupling 9c76177
fix bug
hupling 94df8c3
Merge branch 'test-action-lint' of https://github.com/it-at-m/sps-tes…
hupling 0e29810
test
hupling b5cc77a
Apply suggestion from @hupling
hupling adc9c33
Delete .github/problem-matcher.json
hupling 0bfcd67
Apply suggestion from @hupling
hupling 121488f
chore(deps): lock file maintenance (#1738)
renovate[bot] 7f719fc
fix(deps): update dependency @fontsource/roboto to v5.3.0 (#1737)
renovate[bot] 52c5020
chore(deps): update dependency eslint-plugin-vue to v10.10.0 (#1736)
renovate[bot] a3d4f8a
chore(deps): update dependency @openapitools/openapi-generator-cli to…
renovate[bot] 8ceb5a9
chore(deps): update dependency vite to v8.1.5 (#1728)
renovate[bot] cbaf323
fix(deps): update dependency vue-i18n to v11.4.7 (#1734)
renovate[bot] 8f988b9
chore(deps): update dependency vue-tsc to v3.3.8 (#1730)
renovate[bot] 697b0da
chore(deps): update dependency prettier to v3.9.6 (#1727)
renovate[bot] 28a8da4
chore(deps): update dependency vitest to v4.1.10 (#1729)
renovate[bot] 2c9743a
chore(deps): update registry.access.redhat.com/ubi10/nginx-126 docker…
renovate[bot] 470cd66
chore(deps): update registry.access.redhat.com/ubi10/openjdk-21-runti…
renovate[bot] 25aba4f
chore(deps): update dependency @vitejs/plugin-vue to v6.0.8 (#1726)
renovate[bot] 5eef0f5
fix(deps): update dependency vue to v3.5.40 (#1733)
renovate[bot] e1698e0
:sparkles: Username extraction claim configurable (#1740)
devtobi ff7285b
Apply suggestion from @hupling
hupling 42eaef8
Merge branch 'main' into test-action-lint
hupling File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| # Deno-runtime related vulnerability, irrelevant as Node.js is used | ||
| GHSA-gv7w-rqvm-qjhr | ||
| # brace-expansion (npm) related DoS vulnerability, however irrelevant as we do not use it in production | ||
| CVE-2026-14257 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # For documentation see https://jboss-container-images.github.io/openjdk/ | ||
| FROM registry.access.redhat.com/ubi10/openjdk-21-runtime:1.24-9@sha256:434a4e1c5d6d57c4380ddc0f2c1707ec65df1cb294ea84b21d37ca54aa4b923c | ||
| FROM registry.access.redhat.com/ubi10/openjdk-21-runtime:1.24-10@sha256:3f21794f7e1c568a194798dc36f8bb09da239471fa88d7fa8353efaa091549cc | ||
|
|
||
| # Copy runnable jar to deployments | ||
| COPY target/*.jar /deployments/application.jar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 12 additions & 12 deletions
24
backend/src/main/java/de/muenchen/oss/refarch/backend/security/AuthUtils.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
backend/src/test/java/de/muenchen/oss/refarch/backend/security/AuthUtilsTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| package de.muenchen.oss.refarch.backend.security; | ||
|
|
||
| import static org.assertj.core.api.Assertions.assertThat; | ||
| import static org.mockito.Mockito.when; | ||
|
|
||
| import de.muenchen.oss.refarch.backend.configuration.security.SecurityProperties; | ||
| import org.junit.jupiter.api.AfterEach; | ||
| import org.junit.jupiter.api.Test; | ||
| import org.junit.jupiter.api.extension.ExtendWith; | ||
| import org.mockito.InjectMocks; | ||
| import org.mockito.Mock; | ||
| import org.mockito.junit.jupiter.MockitoExtension; | ||
| import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; | ||
| import org.springframework.security.core.context.SecurityContextHolder; | ||
| import org.springframework.security.oauth2.jwt.Jwt; | ||
| import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken; | ||
|
|
||
| @ExtendWith(MockitoExtension.class) | ||
| class AuthUtilsTest { | ||
|
|
||
| private static final String USERNAME_CLAIM = "preferred_username"; | ||
|
|
||
| @Mock | ||
| private SecurityProperties securityProperties; | ||
|
|
||
| @InjectMocks | ||
| private AuthUtils authUtils; | ||
|
|
||
| @AfterEach | ||
| void tearDown() { | ||
| SecurityContextHolder.clearContext(); | ||
| } | ||
|
|
||
| @Test | ||
| void givenJwtWithUsernameClaim_thenReturnUsername() { | ||
| // given | ||
| when(securityProperties.getUsernameClaim()).thenReturn(USERNAME_CLAIM); | ||
| final Jwt jwt = Jwt.withTokenValue("token") | ||
| .header("alg", "none") | ||
| .claim(USERNAME_CLAIM, "john.doe") | ||
| .build(); | ||
| final JwtAuthenticationToken authentication = new JwtAuthenticationToken(jwt); | ||
| SecurityContextHolder.getContext().setAuthentication(authentication); | ||
|
|
||
| // when | ||
| final String username = authUtils.getUsername(); | ||
|
|
||
| // then | ||
| assertThat(username).isEqualTo("john.doe"); | ||
| } | ||
|
|
||
| @Test | ||
| void givenJwtWithoutUsernameClaim_thenReturnUnauthenticatedUser() { | ||
| // given | ||
| when(securityProperties.getUsernameClaim()).thenReturn(USERNAME_CLAIM); | ||
| final Jwt jwt = Jwt.withTokenValue("token") | ||
| .header("alg", "none") | ||
| .claims(claims -> claims.put("other", "value")) | ||
| .build(); | ||
| final JwtAuthenticationToken authentication = new JwtAuthenticationToken(jwt); | ||
| SecurityContextHolder.getContext().setAuthentication(authentication); | ||
|
|
||
| // when | ||
| final String username = authUtils.getUsername(); | ||
|
|
||
| // then | ||
| assertThat(username).isNull(); | ||
| } | ||
|
|
||
| @Test | ||
| void givenUsernamePasswordAuthentication_thenReturnUsername() { | ||
| // given | ||
| final UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken("jane.doe", "password"); | ||
| SecurityContextHolder.getContext().setAuthentication(authentication); | ||
|
|
||
| // when | ||
| final String username = authUtils.getUsername(); | ||
|
|
||
| // then | ||
| assertThat(username).isEqualTo("jane.doe"); | ||
| } | ||
|
|
||
| @Test | ||
| void givenNoAuthentication_thenReturnUnauthenticatedUser() { | ||
| // given | ||
| SecurityContextHolder.clearContext(); | ||
|
|
||
| // when | ||
| final String username = authUtils.getUsername(); | ||
|
|
||
| // then | ||
| assertThat(username).isEqualTo(AuthUtils.NAME_UNAUTHENTICATED_USER); | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.