Skip to content

RedHatInsights/back-office-proxy-mock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BOP User Service Mock

Provides a mocked set of endpoints backed by a simple Go server and JSON data, to mimic responses from the back-office proxy to use locally.

Usage

go run insights-services.go

Visit any of the supported endpoints below, now available on http://localhost:8090/:

Supported Endpoints

  • Status:
    • http://localhost:8090/insights-services/ - nothing is gonna be resulted
  • Users for an account (V1 endpoint):
    • http://localhost:8090/insights-services/v1/accounts/:id/users - note that the account ID does not matter in this case.
  • Users for an account (V2 endpoint):
    • http://localhost:8090/insights-services/v2/accounts/:id/users - note that the account ID does not matter in this case.
  • Details for a user:
    • http://localhost:8090/insights-services/v1/auth

Future Endpoints

Generating Fake Data

User data exists by default in data/{files}.json, but to populate new/different, use the following:

$ gem install faker
$ ./bin/populate_{name}.rb

Integrating with RBAC

One usecase is to have this mock running for RBAC to use locally. Setting the following in the .env file in RBAC will allow for this:

PRINCIPAL_PROXY_SERVICE_PROTOCOL=http
PRINCIPAL_PROXY_SERVICE_HOST=localhost
PRINCIPAL_PROXY_SERVICE_PORT=8090
PRINCIPAL_PROXY_SERVICE_PATH=/insights-services
PRINCIPAL_PROXY_SERVICE_SSL_VERIFY=False

Currently this will support being able to use the /api/rbac/v1/principals/ GET endpoint.

About

Mock service for the back-office proxy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published