Skip to content

TourmalineCore/auth-api

Repository files navigation

auth-api

Run in Visual Studio

First run this script to run a db and mocked external deps:

docker compose --profile MockForDevelopment up --build

Karate Tests

Run Karate against Api, Db, and MockServer in Docker Compose

Run Api, Db, and MockServer executing the following command (don't close the terminal unless you want to stop the containers)

docker compose --profile MockForTests up --build

Then execute following command inside of the dev-container

Note: for now you need to ask AUTH_LOGIN and AUTH_PASSWORD and add them to devcontainer.json file

java -jar /karate.jar .

Running Karate Tests, Api, Db, and MockServer in Docker Compose

Run the docker compose with MockForPullRequest profile executing the following command (don't close the terminal unless you want to stop the containers)

docker compose --profile MockForPullRequest up --build

Database scheme

This project is based on the TourmalineCore.AspNetCore.JwtAuthentication library which contains Microsoft Identity Platform, so the database schema is inherited from them.

erDiagram
    AspNetRoleClaims{
        int4 Id PK
        bigint RoleId FK
        text ClaimType
        text ClaimValue
    }

    AspNetRoles{
        bigint Id PK
        varchar Name
        varchar NormalizedName
        text ConcurrencyStamp
    }

    AspNetUserClaims{
        int4 Id PK
        bigint UserId FK
        text ClaimType
        text ClaimValue
    }

    AspNetUserLogins{
        text LoginProvider PK
        text ProviderKey PK
        text ProviderDisplayName
        bigint UserId FK
    }

    AspNetUserRoles{
        bigint UserId PK, FK
        bigint RoleId PK, FK
    }

    AspNetUserTokens{
        bigint UserId PK, FK
        text LoginProvider PK
        text Name PK
        text Value
    }

    AspNetUsers{
        bigint Id PK
        bool IsBlocked
        varchar UserName
        varchar NormalizedUserName
        varchar Email
        varchar NormalizedEmail
        bool EmailConfirmed
        text PasswordHash
        text SecurityStamp
        text ConcurrencyStamp
        text PhoneNumber
        bool PhoneNumberConfirmed
        bool TwoFactorEnabled
        timestamptz LockoutEnd
        bool LockoutEnabled
        int4 AccessFailedCount
        bigint AccountId
    }

    RefreshToken{
        bigint Id
        uuid Value
        timestamptz ExpiresIn
        bool IsActive
        text ClientFingerPrint
        bigint UserId FK
        timestamptz ExpiredAtUtc
    }

    __EFMigrationsHistory{
        varchar MigrationId
        varchar ProductVersion
    }

    AspNetRoles ||--|{ AspNetRoleClaims : has
    AspNetRoles ||--|{ AspNetUserRoles : has
    AspNetRoles ||--|{ AspNetRoleClaims : has
    AspNetUsers ||--|{ AspNetUserRoles : has
    AspNetUsers ||--|{ AspNetUserLogins : has
    AspNetUsers ||--|{ AspNetUserClaims : has
    AspNetUsers ||--|{ RefreshToken : has
    AspNetUsers ||--|{ AspNetUserTokens : has
Loading

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 15