Skip to content

rio-cloud/mock-auth-server

Repository files navigation

Build Status License Sonatype Nexus (Snapshots)

Mock Auth Server

Integrate a mock auth server within your Kotlin application to issue tokens for development and testing purpose.

Include library

Currently only SNAPSHOTS are available at the sonatype snapshot repository. Add the following to your buidl.gradle.kts.

repositories {
    maven {
        url = uri("https://oss.sonatype.org/content/repositories/snapshots")
    }
}

dependencies {
    implementation("cloud.rio:mock-auth-server:0.2.0-SNAPSHOT")
}

Usage

Within a (integration) test that requires a token

import cloud.rio.iam.auth.MockAuthServer

fun test() {

    MockAuthServer().use {
        val port = it.start()
        
        // do request a token on the random selected port on localhost   
        
        // do some code/tests with the token
        
        // server is closed automatically after the use-block 
    }

}

License

Mock Auth Server is licensed under the Apache 2.0 license.

About

Mocking Authentication for secured services made easy

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages