-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from neumanf/feature/dashboard
feat: add dashboard and management pages
- Loading branch information
Showing
63 changed files
with
9,214 additions
and
7,941 deletions.
There are no files selected for viewing
This file contains 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,7 +1,7 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
format: | ||
|
This file contains 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
21 changes: 21 additions & 0 deletions
21
apps/api/src/main/java/com/mally/api/auth/AuthenticationManager.java
This file contains 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,21 @@ | ||
package com.mally.api.auth; | ||
|
||
import org.springframework.security.core.context.SecurityContextHolder; | ||
|
||
import java.util.Optional; | ||
|
||
public class AuthenticationManager { | ||
|
||
public static boolean isAuthenticated() { | ||
var user = SecurityContextHolder.getContext().getAuthentication(); | ||
return user instanceof UserJwt; | ||
} | ||
|
||
public static Optional<UserJwt> getAuthenticatedUser() { | ||
if (!isAuthenticated()) { | ||
return Optional.empty(); | ||
} | ||
return Optional.of((UserJwt) SecurityContextHolder.getContext().getAuthentication()); | ||
} | ||
|
||
} |
This file contains 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 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 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
29 changes: 29 additions & 0 deletions
29
apps/api/src/main/java/com/mally/api/pastebin/dtos/SearchPastesDTO.java
This file contains 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,29 @@ | ||
package com.mally.api.pastebin.dtos; | ||
|
||
import com.mally.api.pastebin.entities.PasteSyntax; | ||
import com.mally.api.shared.rest.dtos.PaginationDTO; | ||
import jakarta.annotation.Nullable; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class SearchPastesDTO extends PaginationDTO { | ||
@Nullable | ||
String slug; | ||
|
||
@Nullable | ||
String text; | ||
|
||
@Nullable | ||
PasteSyntax syntax; | ||
|
||
@Nullable | ||
Boolean encrypted; | ||
|
||
@Nullable | ||
String createdAt; | ||
|
||
@Nullable | ||
String expiresAt; | ||
} |
This file contains 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 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 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
Oops, something went wrong.