Skip to content

Instantly share code, notes, and snippets.

@junhuif
junhuif / iam-architecture.md
Created December 24, 2025 12:33 — forked from sunfmin/iam-architecture.md
iam-architecture.md

IAM Architecture for Admin Consoles

This document describes the Identity and Access Management (IAM) architecture for our suite of admin consoles (CMS, OMS, PIM, etc.). The architecture centralizes authentication and authorization through an API Gateway, allowing individual services to focus on business logic.

Table of Contents

  1. Overview
  2. Architecture
  3. Components
  4. Authentication Flows
@junhuif
junhuif / machine.js
Last active April 17, 2020 02:11
Generated by XState Viz: https://xstate.js.org/viz
const SERVICE_ORDER_FETCHER = "orderFetcher";
const STATE_COMPLETED = "completed";
const STATE_FAILED = "failed";
const FETCH_INTERVAL = 500;
const MAX_FETCH_COUNT = 3;
const ERROR_ORDER_CODE_IS_UNDEFINED = new Error("orderCode is undefined");
const ERROR_FETCH_TIMES_OVER_LIMITS = new Error(
@junhuif
junhuif / machine.js
Last active April 15, 2020 10:50
Generated by XState Viz: https://xstate.js.org/viz
const SERVICE_ORDER_FETCHER = "orderFetcher";
const STATE_COMPLETED = "completed";
const STATE_FAILED = "failed";
const FETCH_INTERVAL = 1000;
const MAX_FETCH_COUNT = 60;
const ERROR_ORDER_CODE_IS_UNDEFINED = new Error("orderCode is undefined");
const ERROR_FETCH_TIMES_OVER_LIMITS = new Error(
@junhuif
junhuif / machine.js
Created April 7, 2020 07:33
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@junhuif
junhuif / machine.js
Last active April 7, 2020 06:22
Generated by XState Viz: https://xstate.js.org/viz
const SERVICE_CONFIRM_ORDER_FETCHER = "confirmOrderFetcher";
const ACTION_ON_ORDER_CONFIRMED = "onOrderConfirmed";
const STATE_SUBMITTING = "submitting";
// https://xstate.js.org/viz/?gist=886857c070d6f5a20bc1fd638e99192c
const confirmationMachine = Machine({
id: "confirmation",
initial: "editing",
context: {},
states: {
@junhuif
junhuif / machine.js
Last active April 7, 2020 07:30
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@junhuif
junhuif / machine.js
Last active December 20, 2019 13:34
Generated by XState Viz: https://xstate.js.org/viz
const submitMachine = Machine(
{
initial: "idle",
context: {
orderCode: "some"
},
states: {
idle: {
on: {
SUBMIT: [
App&
Content
Stores
pick store -> Categories
Categories
pick category -> Product List
back to store list -> Stores
Product List
choose product -> Product
back to categories -> Categories
@junhuif
junhuif / dabblet.css
Created June 30, 2018 05:28
Translucent borders
/**
* Translucent borders
*/
body {
background: url('http://csssecrets.io/images/stone-art.jpg');
}
div {
border: 10px solid hsla(0,0%,100%,.5);
@junhuif
junhuif / index.pug
Created September 25, 2017 10:10
react-redux with immutable instead of pureRenderMixin demo
#root