<commit_before># ratpack-jwtauth
Provide an easy to use Json Web Token authentication

Usage
------
Add the module to ratpack module through guice :

        bindingsSpec.add(JsonWebTokenModule.class, config -> {
            config.secret("someSalt");
            config.header("X-Authentication");
            config.authentication("default", UserRepository.class, AuthForm.class, InputType.JSON);
        });

Then to get the info :

        Chain mustBeIdentifiedChain = apiChain.handler(ctx -> {
            try {
                JWTClaims claims = ctx.get(JWTClaims.class);
                // check whatever you want
                ctx.next();
            } catch (NotInRegistryException e) {
                ctx.getResponse().status(403);
                ctx.render("Must be authentified");
            }
        });

Dependency.
------

Gradle

    repositories {
        maven {
            url "http://dl.bintray.com/ylemoigne/maven"
        }
    }

    dependencies {
        compile 'fr.javatic.ratpack:ratpack-jwtauth:0.2'
    }

Changelog.
------
0.1 : Initial Release
0.2 : Add ability for authentication function to return a custom http status code. Add ability to provide authentication function through injected class.<commit_msg>add changelog, fix typo in module name<commit_after># ratpack-jwtauth
Provide an easy to use Json Web Token authentication

Usage
------
Add the module to ratpack module through guice :

        bindingsSpec.add(JWTAuthModule.class, config -> {
            config.secret("someSalt");
            config.header("X-Authentication");
            config.authentication("default", UserRepository.class, AuthForm.class, InputType.JSON);
        });

Then to get the info :

        Chain mustBeIdentifiedChain = apiChain.handler(ctx -> {
            try {
                JWTClaims claims = ctx.get(JWTClaims.class);
                // check whatever you want
                ctx.next();
            } catch (NotInRegistryException e) {
                ctx.getResponse().status(403);
                ctx.render("Must be authentified");
            }
        });

Dependency.
------

Gradle

    repositories {
        maven {
            url "http://dl.bintray.com/ylemoigne/maven"
        }
    }

    dependencies {
        compile 'fr.javatic.ratpack:ratpack-jwtauth:0.2'
    }

Changelog.
------
* 0.1 : Initial Release
* 0.2 : Add ability for authentication function to return a custom http status code. Add ability to provide authentication function through injected class.
* 0.3 : upgrade to Ratpack 0.9.19
{'fraction_non_alphanumeric': 0.1056338028169014, 'fraction_numerical': 0.009389671361502348, 'mean_word_length': 2.033214709371293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '994280', 'n_tokens_mistral': 723, 'n_tokens_neox': 687, 'n_words': 184}