Giter Site home page Giter Site logo

swagger-bundle-example's Introduction

This project is no longer maintained

KleijnWeb\SwaggerBundle Example

Build Status Scrutinizer Code Quality

What's this?

Example for SwaggerBundle 4.0 with support for JWT authentication.

The example app is an extremely basic ticketing system. You can create, search and modify tickets.

Setup

Running the examples requires docker-engine and docker-compose.

After docker-compose up, initialize the database:

docker-compose run app bash -c 'app/console doctrine:database:create --no-interaction && app/console doctrine:migrations:migrate --no-interaction && app/console doctrine:fixtures:load --no-interaction'

Usage

Navigate to http://localhost:8000/ and you can play around with the API.

Fetching a ticket by ID or ticket number is unsecured. Searching for tickets and creating a ticket requires ROLE_USER, modifying and deleting tickets requires ROLE_ADMIN when using a different user (sub claim). The fixture tickets are created with sub "john". Fetching the ticket count by status always requires ROLE_ADMIN.

You'll need the following tokens:

With ROLE_USER (sub "john"):

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqb2huIiwiaXNzIjoiZGV2c2VydmVyIiwiYXVkIjpbInVzZXIiXX0.SeDqiYtJ0S2smaU-kRJrSh_OucpImmbG3Vux35Qk948

Or (sub "jane"):

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqYW5lIiwiaXNzIjoiZGV2c2VydmVyIiwiYXVkIjpbInVzZXIiXX0.4_D5H1FSbHonbqhR33kYK6MPa3BWtUNSdQCDV-btYNo

With ROLE_ADMIN (sub "dick"):

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWNrIiwiaXNzIjoiZGV2c2VydmVyIiwiYXVkIjpbImFkbWluIl19.NvzX-7y-3oW0_gaRX_Pxe_qpPfLHvM54vx_D527mj8U

License

MIT

swagger-bundle-example's People

Contributors

kleijnweb avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.