From 08eb2cc72d84ea1d280fb608a605dc0daaee48f6 Mon Sep 17 00:00:00 2001 From: shreelakshmijoshi Date: Wed, 18 Sep 2024 17:38:09 +0530 Subject: [PATCH] Refactor: Authentication, authorization Refactored classes related to authentication and authorization by
1.Having seperate handlers for authentication, authorization
2. Having seperate AuthHandler for verify policy
3. Changed AuthHandler to have non-static create method
4. Static methods in RoutingContextHelper to add and get info from routing context --- .github/hooks/pre-commit | 64 ------------------- .../AuthClient.java | 0 .../AuthClientInterface.java | 0 .../{IudxRole.java => DxRole.java} | 0 4 files changed, 64 deletions(-) delete mode 100644 .github/hooks/pre-commit rename src/main/java/iudx/apd/acl/server/{authentication => aaaService}/AuthClient.java (100%) rename src/main/java/iudx/apd/acl/server/{authentication => aaaService}/AuthClientInterface.java (100%) rename src/main/java/iudx/apd/acl/server/authentication/authorization/{IudxRole.java => DxRole.java} (100%) diff --git a/.github/hooks/pre-commit b/.github/hooks/pre-commit deleted file mode 100644 index 7e579f06..00000000 --- a/.github/hooks/pre-commit +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -set -e - -RELEASE=1.23.0 -JAR_NAME="google-java-format-${RELEASE}-all-deps.jar" -RELEASES_URL=https://repo1.maven.org/maven2/com/google/googlejavaformat/google-java-format -JAR_URL="${RELEASES_URL}/${RELEASE}/${JAR_NAME}" - -CACHE_DIR="$HOME/.cache/google-java-format-git-pre-commit-hook" -JAR_FILE="$CACHE_DIR/$JAR_NAME" -JAR_DOWNLOAD_FILE="${JAR_FILE}.tmp" -JAR_PGP_ASC_FILE="${JAR_FILE}.asc" -PGP_SIGN_KEY_ID=EE0CA873074092F806F59B65D364ABAA39A47320 - -if [[ ! -f "$JAR_FILE" ]] -then - mkdir -p "$CACHE_DIR" - curl -L "$JAR_URL" -o "$JAR_DOWNLOAD_FILE" - - # Downloaded from: "${JAR_URL}.asc" - cat >"$JAR_PGP_ASC_FILE" <&2 - exit 1 - fi -else - echo "No Java files changes found." -fi \ No newline at end of file diff --git a/src/main/java/iudx/apd/acl/server/authentication/AuthClient.java b/src/main/java/iudx/apd/acl/server/aaaService/AuthClient.java similarity index 100% rename from src/main/java/iudx/apd/acl/server/authentication/AuthClient.java rename to src/main/java/iudx/apd/acl/server/aaaService/AuthClient.java diff --git a/src/main/java/iudx/apd/acl/server/authentication/AuthClientInterface.java b/src/main/java/iudx/apd/acl/server/aaaService/AuthClientInterface.java similarity index 100% rename from src/main/java/iudx/apd/acl/server/authentication/AuthClientInterface.java rename to src/main/java/iudx/apd/acl/server/aaaService/AuthClientInterface.java diff --git a/src/main/java/iudx/apd/acl/server/authentication/authorization/IudxRole.java b/src/main/java/iudx/apd/acl/server/authentication/authorization/DxRole.java similarity index 100% rename from src/main/java/iudx/apd/acl/server/authentication/authorization/IudxRole.java rename to src/main/java/iudx/apd/acl/server/authentication/authorization/DxRole.java