• Stars
    star
    25
  • Rank 955,490 (Top 19 %)
  • Language
    Scala
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An implementation of an OAuth2 server designed for mocking/testing

OAuth2 Mock Play Server

OAuth2 Mock Play Server is an implementation of an OAuth2 server for mocking/testing. It's designed to be configurable by environment variables (by use of the Typesafe config), so it's easy to configure the mock to suit your application's needs. With OAuth2 Mock Play Server, all you have to do is run the server and configure your application's OAuth2 endpoints to the mock server.

Project Intro

OAuth2 Mock Play Server exists out of necessity: The project author searched for an easily configurable, open-source OAuth2 mock server that supported all of the different login flows specified by the OAuth2 specification, and didn't find one. With that in mind, you might also find this project useful, especially if you're creating a web application gated by an OAuth login and need testing and local development support. Typically, you have to explicitly code a flag to disable OAuth2 in your application, or use a production OAuth2 server and deal with port forwarding, reverse proxying, and generating fake certificates to get redirects working.

You can also use OAuth2 Mock Play Server as a replacement for creating mocks physically in your code while running tests. First, set OAUTH2_DISABLE_CONSENT=true. Then run the server and configure your web application to point the mock OAuth2 server while your tests run.

To-Do

  • Add an option to disable all consent screens (handy for tests that run against the mock server)
  • Add some very specific configurations—for example, disabling client_secret checks (not all OAuth2 servers use this)
  • Write tests
  • Create a Docker image
  • Improve documentation
  • Add a Swagger spec for documentation
  • Add logging

Community contributions are welcome: Just file an issue describing the contribution you'd like to make.

Running the Server via Play

  • Load dependencies via sbt update
  • Run via sbt ~run
  • Point your web application OAuth2 endpoints against localhost:9000. See routes for info on the routes and application.conf for guidance on how the configuration works

Note that you might need to disable secure cookies in your web application for this to work, because the server is running over standard HTTP rather than HTTPS.

Docker Image

The project is currently deployed via the Zalando open source write endpoint registry-write.opensource.zalan.do/opensource/oauth2-mock-play:1.0.3. However, the read/pull endpoint is without -write— namely, registry.opensource.zalan.do/opensource/oauth2-mock-play:1.0.3.

To run the Docker image, do:

docker run -it -p 9000:9000 registry.opensource.zalan.do/opensource/oauth2-mock-play:1.0.3

Development

Code Formatting

The project is formatted with scalafmt. Please make sure you run scalafmt in sbt before you make a commit.

License

The MIT License (MIT) Copyright © 2016 Zalando SE, https://tech.zalando.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

oauth2-client-js

A library to help you handle OAuth2 access and refresh tokens
JavaScript
213
star
2

play-swagger

Provides Swagger support for the Play-Framework
Scala
97
star
3

senza

Deploy immutable application stacks and create and execute AWS CloudFormation templates in a sane way
Python
96
star
4

skrop

Image transformation service using libvips, based on Skipper.
Go
86
star
5

java-sproc-wrapper

Java Stored Procedure Wrapper: Calling PostgreSQL stored procedures from Java
Java
65
star
6

sevenseconds

THIS PROJECT IS NOT LONGER ACTIVELY MAINTAINED
Python
65
star
7

pierone

STUPS' Docker registry with S3 backend, immutable tags and SCM source tracking
Clojure
56
star
8

cats.match

Pattern matching for the monads in the cats Clojure library
Clojure
53
star
9

swagger1st

A Clojure Ring handler that parses, validates and routes requests based on your Swagger definitions
JavaScript
45
star
10

taupage

THIS PROJECT IS NOT LONGER ACTIVELY MAINTAINED - The base Amazon Machine Image (AMI) allowing dockerized applications to run with STUPS
Python
44
star
11

even

THIS PROJECT IS NOT LONGER ACTIVELY MAINTAINED
Clojure
41
star
12

fullstop

Audit reporting: collect violations across all AWS accounts
Java
40
star
13

booties

Some Spring Boot starters to ease integration of your application into STUPS
Java
38
star
14

spring-boot-etcd

An etcd client for accessing and storing configuration values in an etcd cluster
Java
34
star
15

odd

THIS PROJECT IS NOT LONGER ACTIVELY MAINTAINED
Dockerfile
31
star
16

stups-etcd-cluster

Etcd cluster appliance for the STUPS (AWS) environment
Python
29
star
17

planb-cassandra

Plan B Cassandra for STUPS/AWS with static IPs
Python
27
star
18

swagger-codegen-tooling

Tooling around Maven and Gradle to generate code from OpenAPI/Swagger specs
Java
26
star
19

kio

The application registry in the STUPS ecosystem
Clojure
23
star
20

httpie-zign

Zign OAuth plugin for HTTPie
Python
22
star
21

play-zhewbacca

Play! framework library to protect REST endpoint by OAuth2 token verification - THIS PROJECT IS NOT LONGER ACTIVELY MAINTAINED
Scala
22
star
22

lizzy

REST Service to deploy AWS CloudFormation templates using Senza
Python
21
star
23

docker-openjdk

DEPRECATED: Docker image with OpenJDK and Zalando CA
Shell
21
star
24

documentation

Documentation for the STUPS ecosystem
Python
18
star
25

clair-sqs

CoreOS' Clair packaged for use with AWS SQS and SNS
Go
18
star
26

planb-tokeninfo

Plan B Token Info service for JWT tokens
Go
17
star
27

stups-spring-oauth2-support

Spring-OAuth2 STUPS support - THIS PROJECT IS NOT LONGER ACTIVELY MAINTAINED
Java
16
star
28

planb-provider

Plan B OpenID Connect Provider issuing JWT tokens
Java
16
star
29

ssh-tunnels

Command line utility to manage SSH tunnels for cluster applications on AWS
Python
15
star
30

python-tokens

Python library to manage OAuth access tokens
Python
14
star
31

zign

Command line client to generate OAuth2 access tokens
Python
12
star
32

berry

STUPS-related agent to retrieve application credentials
Python
12
star
33

put-it-to-rest

Java
11
star
34

aws-credentials-service

Get temporary AWS credentials from OAuth token
Python
11
star
35

baigan-config

Simple and distributed configuration service framework
Java
10
star
36

react-automatic-width

Automatically sets `width` property on child components
JavaScript
10
star
37

api-first-hand-service

API-First-Hand activator template
JavaScript
10
star
38

pierone-cli

DEPRECATED: Convenient command line client for STUPS' Pier One Docker registry
Python
10
star
39

mint-worker

The secret rotator and distributor for the STUPS ecosystem
Clojure
9
star
40

docker-ubuntu

DEPRECATED: Ubuntu base image including Zalando CA
Dockerfile
9
star
41

stups-cli

PyPI meta package to pull user CLI tools
Python
9
star
42

planb-revocation

Plan B Revocation Service for JWT tokens
Java
9
star
43

docker-python

DEPRECATED: Docker image with Python 3.6 and Zalando CA
Dockerfile
8
star
44

essentials

The repository for resource types and OAuth 2.0 scopes in the STUPS ecosystem
Clojure
8
star
45

docker-node

DEPRECATED: Docker image with Node.js and Zalando CA
Dockerfile
8
star
46

yourturn

The frontend/developer console for the STUPS infrastructure
JavaScript
8
star
47

lizzy-client

Client tool to deploy Senza definitions using a Lizzy Agent (REST API)
Python
7
star
48

stups-gotthard

Gotthard provides tunneling for PostgreSQL in a STUPS environment
Python
7
star
49

spring-boot-zalando-stups-tokens

Spring-Boot integration for STUPS OAuth2 - THIS PROJECT IS NOT LONGER ACTIVELY MAINTAINED
Java
6
star
50

mint-storage

The secret rotator and distributor for the STUPS ecosystem
Clojure
6
star
51

piu

THIS PROJECT IS NO LONGER ACTIVELY MAINTAINED - The command line client for Even, the SSH access-granting service of STUPS
Python
6
star
52

superagent-oauth2-client

A superagent plugin for stressless OAuth2 token management
JavaScript
6
star
53

twintip-spring-web

Twintipify your Spring Web MVC application
Java
6
star
54

stups-cli-support

STUPS support library for command line tools
Python
5
star
55

kio-cli

CLI tool for Kio application registry
Python
5
star
56

magnificent

Reference implementation for the STUPS authorization server
Clojure
4
star
57

kio-client-java

Client-Implementation for kio
Java
4
star
58

python-scm-source

Python module to generate scm-source JSON objects according to STUPS docs
Python
4
star
59

planb-docs

Plan B OAuth2/JWT Infrastructure Documentation
Python
4
star
60

log-sink

Central sink for audit- and traceability log files
Java
3
star
61

fullstop-cli

Simple command line utility to view and resolve fullstop. violations
Python
3
star
62

docker-alpine

DEPRECATED: Alpine Linux base image including Zalando CA
Dockerfile
3
star
63

leanix-admin-cli

Command line tool that can be used to backup and restore model files from LeanIX
Python
3
star
64

hutmann

Simple OAuth2 for Play! backend services
Scala
3
star
65

aws-support-spring-boot-starter

Minimal Spring-Boot-Starter that detects if an application is running on AWS or not and exposes some properties, if it is
Java
3
star
66

zmon-entity-adapter

Push STUPS entities (such as KIO applications) to ZMON
Python
3
star
67

lein-scm-source

A Leiningen plugin to generate a scm-source.json file according to the STUPS documentation
Clojure
3
star
68

node-scm-source

NPM module to generate scm-source JSON objects according to STUPS docs
JavaScript
2
star
69

zalando-stups.github.io

Overview of the STUPS landscape with all components
CSS
2
star
70

sbt-stups

SBT-stups is an sbt plugin that contains a set of related tasks for deploying sbt applications into stups environments
Scala
2
star
71

stups-build

Centralized Maven configuration used by some libraries in STUPS
1
star
72

pierone-client-java

Java client library for STUPS' Pier One Docker registry
Java
1
star
73

scala-typesafe-config-tokens

A Scala typesafe config wrapper over the Tokens library that is used for STUPS authentication - THIS PROJECT IS NOT LONGER ACTIVELY MAINTAINED
Scala
1
star