Skip to content

Commit

Permalink
*******Must be reverted********
Browse files Browse the repository at this point in the history
  • Loading branch information
sorydi3 committed Jan 4, 2025
1 parent fd8b57d commit ff93ba0
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 18 deletions.
49 changes: 49 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers/features/java:1": {
"installGradle": true,
"installMaven": true,
"installAnt": true,
"installGroovy": true,
"version": "17",
"jdkDistro": "ms",
"gradleVersion": "latest",
"mavenVersion": "latest",
"antVersion": "latest",
"groovyVersion": "latest"
},
"ghcr.io/devcontainers/features/python:1": {
"installTools": true,
"version": "latest"
}
},

"mounts": [
{
"source": "${localEnv:HOME}${localEnv:USERPROFILE}/.ssh",
"target": "/home/vscode/.ssh",
"type": "bind"
}]



// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
25 changes: 25 additions & 0 deletions apend_properties_to_lang_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Description: This script appends a multi-line string to the end of all the files in the folder that end with _[A-Za-z][A-Za-z].properties

cd src/main/resources

# The multi-line string to append to the end of the file with EOF
STRING_TO_APPEND=$(cat <<EOF
#Template strings image to pdf
imageToPDF.templates=Templates
imageToPDF.selectLabel.templates=Templates Options (Enabled only when templates are selected in fitOptions)
imageToPDF.selectText.templates.1=1x2
imageToPDF.selectText.templates.2=2x2
imageToPDF.selectText.templates.3=2x3
EOF
)

# Loop through all the files in the folder that end with .properties
for file in *_[A-Za-z][A-Za-z].properties
do
# Append the multi-line string with a newline to the end of the file
echo "$STRING_TO_APPEND" >> "$file"
done
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package stirling.software.SPDF.config.security;

import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
Expand All @@ -13,6 +17,7 @@
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.oauth2.core.user.OAuth2User;
import org.springframework.stereotype.Service;

import stirling.software.SPDF.config.DatabaseBackupInterface;
import stirling.software.SPDF.config.security.session.SessionPersistentRegistry;
import stirling.software.SPDF.controller.api.pipeline.UserServiceInterface;
Expand All @@ -23,10 +28,6 @@
import stirling.software.SPDF.repository.AuthorityRepository;
import stirling.software.SPDF.repository.UserRepository;

import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;

@Service
public class UserService implements UserServiceInterface {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package stirling.software.SPDF.controller.web;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
Expand All @@ -13,6 +13,14 @@
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import io.swagger.v3.oas.annotations.tags.Tag;

import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import stirling.software.SPDF.config.security.session.SessionPersistentRegistry;
import stirling.software.SPDF.model.*;
import stirling.software.SPDF.model.ApplicationProperties.Security.OAUTH2;
Expand All @@ -22,11 +30,6 @@
import stirling.software.SPDF.model.provider.KeycloakProvider;
import stirling.software.SPDF.repository.UserRepository;

import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;

@Controller
@Slf4j
@Tag(name = "Account Security", description = "Account Security APIs")
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/stirling/software/SPDF/model/User.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package stirling.software.SPDF.model;

import jakarta.persistence.*;

import java.io.Serializable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import jakarta.persistence.*;

@Entity
@Table(name = "users")
public class User implements Serializable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package stirling.software.SPDF.repository;

import java.util.Optional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import stirling.software.SPDF.model.User;

import java.util.Optional;
import stirling.software.SPDF.model.User;

@Repository
public interface UserRepository extends JpaRepository<User, Long> {
Expand Down

0 comments on commit ff93ba0

Please sign in to comment.