[PlantiFy] MSA 환경에서 JWKS 기반 분산 인증 구현 - RS256 전환 + common-auth-lib
·
💻/프로젝트
전체 구조 요약auth-service → RSA 개인키로 JWT 서명 (RS256) → /.well-known/jwks.json 으로 공개키 노출각 서비스 → JWKS 엔드포인트에서 공개키 캐싱 → Auth 호출 없이 로컬에서 JWT 검증 설계 배경과 기존 `/validate-token` 구조의 문제점[PlantiFy] MSA 환경에서 Kakao Social Login 구현하기 - 서비스 개요 / Auth 병목 문제와 JWKS 기반 분산 인증 구조 개선 [PlantiFy] MSA 환경에서 Kakao Social Login 구현하기 - 서비스 개요 / Auth 병목 문제와 JWKS 기반 분산 인증서비스 개요 및 상황Gateway 병목 피하려고 Auth 서버 분리Gateway 중앙화: 인증, 라우팅,..
[LeetCode 75/Graphs - BFS] 1926 - Nearest Exit from Entrance in Maze / 994 - Rotting Oranges
·
✏️/LeetCode
1926 - Nearest Exit from Entrance in Maze풀이2차원, 정점 (r, c), 상하좌우 이동`.`: 이동 가능 / `+`: 벽 (이동 불가)출구: 가장자리에 있는 `.` (!= 시작점)int[] dr = {1, -1, 0, 0};int[] dc = {0, 0, 1, -1}; `q.offer(new int[]{r, c, dist})`: (행, 열, 거리)`maze[nr][nc] = '+'`: 지나간 곳을 벽으로 바꿈코드class Solution { int m, n; int[] dr = {1, -1, 0, 0}; int[] dc = {0, 0, 1, -1}; int bfs(char[][] maze, int[] entrance) { Queue q =..
[LeetCode 75/Binary Search Tree] 700 - Search in a Binary Search Tree / 450 - Delete Node in a BST (Java)
·
✏️/LeetCode
700 - Search in a Binary Search Tree풀이BST에서 값이 val과 같은 노드 찾고 그 노드를 root로 하는 subtreeBST: 왼쪽 subtree node.val > val -> 왼쪽으로 이동node.val 오른쪽으로 이동코드class Solution { public TreeNode searchBST(TreeNode root, int val) { if (root == null) return null; if (root.val == val) return root; if (val 450 - Delete Node in a BST풀이BST에서 값 key 가진 노드 찾아 삭제하고 삭제 후에도 BST 성질 유지 BST: 왼쪽 subtree n..
[LeetCode 75/Binary Tree - BFS] 199 - Binary Tree Right Side View / 1161 - Maximum Level Sum of a Binary Tree (Java)
·
✏️/LeetCode
199 - Binary Tree Right Side View풀이이진 트리의 루트 노드가 주어졌을 때, 트리를 오른쪽에서 바라봄-> 각 높이(level)마다 맨 오른쪽 노드만 보임=> 각 레벨에서 마지막 노드 찾기 BFS로 트리를 레벨 순서로 탐색ex. root = [1, 2, 3, , null, 5, null, 4]level 0 / [1] => 1level 1 / [2, 3] => 3level 2 / [5, 4] => 4=> [1, 3, 4]코드class Solution { public List rightSideView(TreeNode root) { List arr = new ArrayList(); if (root == null) return arr; Queue..
[LeetCode 75/Binary Tree - DFS] 437 - Path Sum 3 / 1372 - Longest ZigZag Path in a Binary Tree / 236 - Lowest Common Ancestor of a Binary Tree (Java)
·
✏️/LeetCode
437 - Path Sum 3풀이부모 -> 자식 경로 중 합이 `targetSum`인 경로 개수=> 모든 노드를 시작점으로 생각 `int dfs(TreeNode node, long target)`: 현재 node에서 시작해서 아래로 내려가며 합이 `target`이 되는 경로 개수`int pathSum(TreeNode root, int targetSum)`: 모든 노드를 시작점으로 고려`dfs(root, targetSum)`: root에서 시작하는 경로 개수`pathSum(root.left, targetSum)`: 왼쪽 subtree에서 시작하는 경로 개수`pathSum(root.right, targetSum)`: 오른쪽 subtree에서 시작하는 경로 개수코드class Solution { int d..
[LeetCode 75/Binary Tree - DFS] 104 - Maximum Depth of Binary Tree / 872 - Leaf-Similar Trees / 1448 - Count Good Nodes in Binary Tree (Java)
·
✏️/LeetCode
104 - Maximum Depth of Binary Tree풀이이진 트리 노드 정의 클래스`val`: 자기 값`left`: 왼쪽 자식`right`: 오른쪽 자식class TreeNode { int val; TreeNode left; TreeNode right; TreeNode() {} TreeNode(int val) { this.val = val; } TreeNode(int val, TreeNode left, TreeNode right) { this.val = val; this.left = left; this.right = right; }} 최대 깊이: 루트에서 가장 먼 리프 노드까지의 가장 긴 경로에 ..
aeongg
빙글빙글 돌아가는 Debug 하루