Saasli / saasli-backend

Documentation
https://saasli.github.io/docs/
0 stars 0 forks source link

Write a payload verifier #17

Closed godd9170 closed 7 years ago

godd9170 commented 8 years ago

The responses to our endpoints leave a lot to be desired. Currently it's basically 'Success' or 'Failure'. I believe we need the following:

godd9170 commented 7 years ago

As per #32, I think it's appropriate to have Response/Request classes for each endpoint instead of a shared one up in tools.py. I've been racking my brain as to how we can have a mutual Request class that's abstract enough for all... but I think that's probably too meta.

File structure is currently:

├── account
│   └── handler.py
├── contact
│   └── handler.py
├── encryption
│   └── handler.py
├── event
│   └── handler.py
├── serverless.yml
└── tools.py <-- Request/Response are in here

and what's going to make more sense is:

├── account
│   ├── handler.py
│   ├── Response.py
│   └── Request.py
├── contact
│   ├── handler.py
│   ├── Response.py
│   └── Request.py
├── encryption
│   └── handler.py
│   ├── Response.py
│   └── Request.py
├── event
│   ├── handler.py
│   ├── Response.py
│   └── Request.py
├── serverless.yml
└── tools.py

This will also help facilitate #33

godd9170 commented 7 years ago

I've changed my mind again... Response.py in theory is going to be very similar if we want to unify what our responses look like across the API. Furthermore, the base of Request is going to have some similarities so I'm proposing extending it for each endpoint. I'm envisioning this now:

├── account
│   ├── handler.py
│   └── AccountRequest.py
├── contact
│   ├── handler.py
│   └── ContactRequest.py
├── encryption
│   └── handler.py
│   └── EncryptionRequest.py
├── event
│   ├── handler.py
│   └── EventRequest.py
├── serverless.yml
├── Request.py
├── Response.py
└── tools.py
godd9170 commented 7 years ago

I can comfortably say that the new Request class in tools.py and it's endpoint specific extensions are more than solving this.