Giter VIP home page Giter VIP logo

iam-dashboard's Introduction

INDIGO IAM Dashboard

github-build-status

INDIGO IAM Dashboard is the web application of INDIGO IAM developed by INFN.

Introduction

The dashboard is implemented in TypeScript, using React and Next.js. The OpenID Connect authorization flow is handled by Auth.js

Development

Even though not strictly necessary, it is highly recommended to use VSCode with the Dev Containers integration.

This project is provided with a docker-compose.yaml which runs the following services

  • iam-backend: INDIGO IAM backend (and old dashboard)
  • iam-database: MySQL instance for IAM backend
  • iam-dashboard: the new dashboard (core of this project)
  • iam-nginx: NGINX proxy pass instance which route the traffic between services

Start the services

It is possible to start all services from within VSCode, launching the command Reopen in Container. Otherwise, it is possible to manually start the services with

docker compose up -d

and then, in VSCode, attach the session with Attach to Running Container...

Prepare the environment

The application needs .env file to setup some configuration variables. For development define the following variables:

# .env
NODE_ENV=debug
IAM_AUTHORITY_URL=https://iam-dev.cloud.cnaf.infn.it # or http://localhost:8080
IAM_CLIENT_ID=<your_client_id>
IAM_CLIENT_SECRET=<your_client_secret>
AUTH_SECRET=<authentication_secret>                  # see below

AUTH_SECRET is a variable to securely protect session cookies for authentication. You could generate a secret running

openssl rand -base64 32

Start the development server

After launching the services, from VSCode, within the iam-dashboard container, start the development server

npm run dev

Something similar to the following should be prompted:

> [email protected] dev
> next dev -p 8080

  ▲ Next.js 14.2.2
  - Local:        http://localhost:8080
  - Environments: .env

 ✓ Starting...
 ✓ Ready in 9.5s

IAM Client Configuration

The dashboard acts as client for IAM backend and thus, registering the client is required. This step is required the first time only, and whenever the database volume is deleted/recreated.

To register a new client, go to http://localhost:8081/ to load the old dashboard, or go to your production IAM instance. Login as admin and register a new client. Give it a name, such as iam-dashboard and add the <IAM_URL>/auth/callback/indigo-iam

(without the trailing /) URL to the Redirect URIs. In Scopes, assure that the following scopes are enabled

  • email
  • offline_access
  • openid
  • profile
  • scim:read
  • scim:write

In Grant Types, enable authorization_code. Finally, in the Crypto section enable PKCE with SHA-256 has algorithm. Save the client and copy client_id and client_secret, then edit the envs/dev.env file replacing IAM_CLIENT_ID with the correct values.

Deployment

A Docker image is automatically built using GitHub Action. As for development, the same environment variables are required, plus the AUTH_URL variable. The latter is need when the application is behind a docker image or proxy which hides the current hostname.

Create the following environment file, giving your preferred name, for example prod.env

# prod.env
IAM_AUTHORITY_URL=https://iam-dev.cloud.cnaf.infn.it # or http://localhost:8080
IAM_CLIENT_ID=<your_client_id>
IAM_CLIENT_SECRET=<your_client_secret>
AUTH_SECRET=<authentication_secret>
AUTH_URL=<dashboard_hostname>  # e.g. https://iam-dashboard.cloud.cnaf.infn.it

To start the application then run

docker run -p <some-port>:80 --env-file=prod.env cnafsoftwaredevel/iam-dashboard:latest

TODOs

General

  • Sudo mode (panic!)
  • Add Table component

Home page

  • Validate password before submission
  • Whats happen if I change password when there is no password at all?
  • Finish the "Add to group" functionality
  • Add "Change membership end time"
  • Add "Link external account" feature
  • Add "Link Certificate"
  • Add "Request Certificate"
  • Add "Add managed proxy certificate"
  • Add "Add ssh key"
  • Add "Set attribute"

Users Page

  • Create the users table
  • Add "Delete user" button per each row
  • Maybe add a multiple selection to delete multiple users in bulk

Groups Page

  • Create the groups page
  • Add "Add Root Group" feature
  • Add "Add Subgroup" button per each row (?!)
  • Add "Delete Group" button per each row

Requests Page

  • Create "Registration Request" tab
  • Create "Group requests" tab

AUP Page

  • Add "Edit AUP"
  • Add "Request AUP Signature"
  • Add "Delete AUP"

Clients Page

  • Add Clients table
  • Add "New Client"
  • Add "Edit client" per each row
  • Add "Delete client" per each row
  • Add Client "edit" page with tabs:
    • Main (client name, client id, client description, redirect URIs, contacts, etc)
    • Credentials (Token endpoint auth method, client secret, registration access token, regenerate registration a.c., Public key set, JWK URI)
    • Scopes (System scope, Custom scope)
    • Grant types
    • Tokens (A.T. timeout, ID T. timeout, R.T settings & timeout, Device code timeout)
    • Crypto (PKCE settings)
    • Other info (Homepage URL, ToS, Policy)
    • Owners (Show owners, assign owner)

Tokens Page

  • ???

Scopes

  • Add Scopes table
  • Add "Edit Scope" button per each row (Description, default scope, restricted)
  • Add "Delete scope" button per each row

iam-dashboard's People

Contributors

jacogasp avatar stedev2 avatar enricovianello avatar

Stargazers

 avatar

Watchers

 avatar Francesco Giacomini avatar  avatar Carmelo Pellegrino avatar  avatar Alessandro Costantini avatar Federica Agostini avatar Saiteja Reddy Vennapusa avatar

iam-dashboard's Issues

Implement Edit User Infos

Example request
PATCH /scim/Me HTTP/1.1

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "operations": [
        {
            "op": "replace",
            "value": {
                "displayName": "Admin User",
                "name": {
                    "givenName": "Admin",
                    "familyName": "User",
                    "middleName": ""
                }
            }
        },
        {
            "op": "replace",
            "value": {
                "emails": [
                    {
                        "type": "work",
                        "value": "[email protected]",
                        "primary": true
                    }
                ]
            }
        },
        {
            "op": "replace",
            "value": {
                "photos": [
                    {
                        "type": "photo",
                        "value": "https://i.redd.it/vton9zwqv3f61.jpg"
                    }
                ]
            }
        }
    ]
}

Note: only the actually changed parameters must be sent to back

Making the Drawer Responsive

Currently, the drawer component is not responsive, it has a fixed width in /workspace/src/components/Page/index.tsx
const drawerWidth = "320px";.
We propose implementing responsive design to adapt the drawer component based on the viewport size.

Adding Version to the Drawer Footer

We propose adding the version of the software in the Drawer Footer, currently it is fixed in /workspace/src/components/Page/Sidebar.tsx
<div className="infn-version">v1.0</div>

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.