jaguar_jwt 0.1.0 copy "jaguar_jwt: ^0.1.0" to clipboard
jaguar_jwt: ^0.1.0 copied to clipboard

outdatedDart 1 only

JWT interceptor and utilities for Jaguar

Build Status

jaguar_jwt #

JWT authentication interceptor for Jaguar

Usage #

A simple usage example:

/// File: main.dart
library jaguar.example.silly;

import 'dart:async';
import 'dart:io';
import 'package:jaguar/jaguar.dart';
import 'package:jaguar_jwt/jaguar_jwt.dart';

part 'main.g.dart';

@Api(path: '/api')
class ExampleApi extends _$JaguarExampleApi {
  int _pingCount = 0;

  @Route('/ping', methods: const <String>['GET'])
  String ping() => "You pinged me ${++_pingCount} times, silly!";

  @JwtAuth(const JwtInfo('secret here'), const <String>['player', 'admin'])
  @Route('/pong', methods: const <String>['POST'])
  String pong() => "Your silly pongs have no effect on me!";
}

Future<Null> main(List<String> args) async {
  ExampleApi api = new ExampleApi();

  Configuration configuration = new Configuration();
  configuration.addApi(api);

  await serve(configuration);
}
75
likes
0
pub points
96%
popularity

Publisher

unverified uploader

JWT interceptor and utilities for Jaguar

Homepage

License

unknown (license)

Dependencies

auth_header, dart_jwt, jaguar, jaguar_auth, jaguar_generator

More

Packages that depend on jaguar_jwt