jenyayel / SwaggerSecurityTrimming

Demo for trimming visibility of endpoints in Swagger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demo for Swagger security trimming

For details see blog post.

There are demos for multiple versions of Swagger and framework versions, see project files for version information.

Running

To run the demo:

  • Have .NET Core installed
  • Clone the repo
  • Execute:
cd src/V3 # or previous versions
dotnet run

Using tokens below different endpoint will be showen in Swagger.

Tokens

Authenticated user:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.lMQZ-L2fcyy9tgM_RyOt7BCyHnnryQweBmhgVUC9Qc4

With scope can-update:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZXMiOlsiYXBpOnVwZGF0ZSJdfQ.ok6saWx1101ygDqz-GrhHBJMyINUB2NqpE4k6BYc47s

With scope can-delete:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZXMiOlsiYXBpOmRlbGV0ZSJdfQ.6YAU8_DLiyixE2xxoGuZnPTOo6Dzoz4cQ3QzM69p5o4

With both scopes can-update and can-delete:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZXMiOlsiYXBpOnVwZGF0ZSIsImFwaTpkZWxldGUiXX0.DXynNpRlNLUWevAazv4vEOLYDGzkEfI8OAnP2qihJr8

About

Demo for trimming visibility of endpoints in Swagger

License:MIT License


Languages

Language:C# 73.9%Language:HTML 15.4%Language:JavaScript 10.7%