Giter Site home page Giter Site logo

iam-service-webflux's Introduction

IAM Sample

Local Development

yb-ctl destroy && yb-ctl --rf 3 create --tserver_flags="cql_nodelist_refresh_interval_secs=10" --master_flags="tserver_unresponsive_timeout_ms=10000"
ysqlsh -c 'create database iam'
ysqlsh -d iam -f src/main/resources/schema.sql
ysqlsh -d iam -f src/main/resources/data-user_profile.sql
ysqlsh -d iam -f src/main/resources/data-user_credentials.sql
ysqlsh -d iam -f src/main/resources/data-user_svc_account.sql
ysqlsh -d iam -f src/main/resources/data-user_audit.sql

./mvnw clean
./mvnw spring-boot:run

Run On Terminal 2

curl "http://localhost:8081/user/profile?userId=fleadley0" --silent| jq

Output:

{
  "userProfileId": 1,
  "firstName": "Leena",
  "lastName": "Le feaver",
  "gender": "M",
  "birthday": "2013-01-30",
  "email": "[email protected]",
  "emailVerified": "N",
  "createTime": "2021-08-21T11:56:01.000+00:00",
  "lastAccessTime": "2021-07-18T09:02:38.000+00:00",
  "salutation": "Ms",
  "serviceAccount": [
    {
      "accountId": 1,
      "userId": "fleadley0",
      "creationTime": "2021-12-03T23:22:22.000+00:00",
      "lastAccessTime": "2022-04-18T10:01:59.000+00:00",
      "userVerified": "Y",
      "svcName": "svc1",
      "svcDescription": "Service 1"
    },
    {
      "accountId": 2,
      "userId": "fleadley0",
      "creationTime": "2021-12-03T23:22:22.000+00:00",
      "lastAccessTime": "2022-04-18T10:02:59.000+00:00",
      "userVerified": "Y",
      "svcName": "svc2",
      "svcDescription": "Service 2"
    }
  ],
  "userActivities": [
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-22T01:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 9 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-22T00:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 8 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-22T00:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 8 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T23:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 7 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T23:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 7 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T22:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 6 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T22:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 6 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T21:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 5 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T21:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 5 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T20:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 4 - Kefar Shemaryahu"
    }
  ]
}
curl "http://localhost:8081/user/auth\?userId\=fleadley0\&passwordHash\=tVOKv51X" --slient | jq

Output:

{
  "userProfileId": 1,
  "firstName": "Leena",
  "lastName": "Le feaver",
  "gender": "M",
  "birthday": "2013-01-30",
  "email": "[email protected]",
  "emailVerified": "N",
  "createTime": "2021-08-21T11:56:01.000+00:00",
  "lastAccessTime": "2021-07-18T09:02:38.000+00:00",
  "salutation": "Ms",
  "serviceAccount": [
    {
      "accountId": 1,
      "userId": "fleadley0",
      "creationTime": "2021-12-03T23:22:22.000+00:00",
      "lastAccessTime": "2022-04-18T10:01:59.000+00:00",
      "userVerified": "Y",
      "svcName": "svc1",
      "svcDescription": "Service 1"
    },
    {
      "accountId": 2,
      "userId": "fleadley0",
      "creationTime": "2021-12-03T23:22:22.000+00:00",
      "lastAccessTime": "2022-04-18T10:02:59.000+00:00",
      "userVerified": "Y",
      "svcName": "svc2",
      "svcDescription": "Service 2"
    }
  ],
  "userActivities": [
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-22T01:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 9 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-22T00:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 8 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-22T00:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 8 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T23:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 7 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T23:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 7 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T22:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 6 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T22:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 6 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T21:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 5 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T21:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 5 - Kefar Shemaryahu"
    },
    {
      "action": "login",
      "description": "user logged in from web",
      "transactionTime": "2022-07-21T20:21:22.000+00:00",
      "device": "tablet",
      "clientIp": "36.96.14.13",
      "location": "LOC 4 - Kefar Shemaryahu"
    }
  ]
}

iam-service-webflux's People

Contributors

chenliangryan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.