v0.0.1

Minimal Viable Product

adm-server-v0.0.1 will provide

  1. a method for mocking Keycloak and typical Django Rest Framework endpoints,

  2. a basic request matching utility that

    1. performs matches on the requested uri including the query string, for example given the request http://localhost/widgets?id=1 the match string is widgets?id=1,

    2. uses simple comparison matching, i.e. matches exactly the first N characters of each string (where N is the length of the configured path), to determine if there is a match or not.

  3. the user with control over the entire Http Response Message.

Configuration

All configuration is controlled by files.

  1. System configuration is found in server.yaml (YamlMap).

    server:
        port: Integer (Default 1025)
        host: String (Default '0.0.0.0')
    
  2. Response is controlled by endpoints/index.yaml (YamlList) 1.

    - response: String (Required)
        path: String (Default '/')
        method: String (Default Any)
        query: String (Default None)
    
  3. Need to address need for a min default endpoint

Execution

Change to the root of the directory containing server.yaml and endpoints/ and execute

$ adm-server

System Overview

This section generally describes the interaction between primary objects.

Primary Objects

  1. Server: creates a socket and listens for requests.

  2. Sources: file system management.

  3. Endpoint: pattern matching and routing.

  4. ResponseWriter: http response to client.

Data Flow

  1. Client asks Server for a an HttpResponse (HttpRequest).

  2. Server asks Sources for an Endpoint.

  3. Server asks Endpoint for a Response

  4. Server asks Response for an Http Message.

  5. Server gives Client the HttpResponse

Http response for unmatched request:

HTTP/1.1 452 Unmatched
x-requested-uri: REQUESTED_URI\n\n

Example

# Request
GET /alpha HTTP/4.2
...

# Response
HTTP/4.2 452 Unmatched
x-requested-uri: alpha
...

Build Strategy:

How a user builds a set of mock data.

Post installation simply starting the server will give instructions on what to do next.

e.g.

cd to desired directory, run adms, follow instructions

Release Tests

  1. Return the required default endpoint response (200 Ok).

  2. An unmatched response (452 Unmatched) 2.

References

  1. https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

  2. https://developer.mozilla.org/en-US/docs/Web/HTTP/Messages

1

Why not just endpoints.yaml?

A future release will support multiple files in nested directories.

2

This is the authoratative value for Http Response Label.