Skip to content

IAM Client for Identity and access management service base on Vapor Web Framework.

Notifications You must be signed in to change notification settings

qi-shun-wang/IAM-Service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Register IAMConfig (in configure.swift)

let exceptionPaths = ["/v1/identity/check","/v1/identity/token"]
let hostname = "http://localhost"
let port = 8080
let iamConfig = IAMConfig(hostname: hostname,
                          port: port,
                          exceptionPaths: exceptionPaths)
services.register(iamConfig)

Create extension of allowing IAM policy (User or any object)

import IAM
extension User: IAMPolicyAllowable {}

Grouped Router with Middleware (in any route collection)

let allowedPolicy = User.IAMAuthPolicyMiddleware(allowed: ["ROOT"])
let groups = router.grouped("groups").grouped(allowedPolicy)

About

IAM Client for Identity and access management service base on Vapor Web Framework.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages