Napping Peanut Monsters

    krc-role-acl

    1.0.0 • Public • Published

    role-based-authorization

    Middlewares

    import { roleBasedAuthorization, validAuthentication, validSupportOrigin } from "role-based-authorization";
    

    1. validAuthentication

    Using json web token to basic authentication.

    valid request:

    headers:
        {
            "Authorization": {jwtToken}
        }
    

    2. validSupportOrigin

    Using json web token to fitlering token support request origin.

    valid token:

    token payload: {
        'allowed-origins': [listSupportOrigin]
    }
    

    3. roleBasedAuthorization

    Using role-based access to authorization

    used:

    roleBasedAuthorization(allowRolesString)
    

    valid allow roles string:

    • role name with sso sever defines
    • multiple role names with ","
    • allow all roles with allowRolesString = "*"

    Keywords

    none

    Install

    npm i krc-role-acl

    DownloadsWeekly Downloads

    0

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    24.8 kB

    Total Files

    26

    Last publish

    Collaborators

    • luonguit