Skip to content

Instantly share code, notes, and snippets.

View ColeDrain's full-sized avatar

Ugochukwu Onyebuchi ColeDrain

View GitHub Profile
@ColeDrain
ColeDrain / banks.json
Created September 19, 2024 16:25 — forked from LordGhostX/banks.json
List of Nigerian Banks and Codes
{
"9 payment service Bank": "120001",
"AB MICROFINANCE BANK": "090270",
"ABBEY MORTGAGE BANK": "070010",
"ABOVE ONLY MICROFINANCE BANK": "090260",
"ABU MICROFINANCE BANK": "090197",
"ACCESS BANK": "000014",
"ACCESSMONEY": "100013",
"ACCION MFB": "090134",
"ADDOSSER MFBB": "090160",
@ColeDrain
ColeDrain / readme.md
Last active October 21, 2021 10:46
Proof of Concept

Data Read POC Post Method

Plugins can read data from the database by calling /data/read using a POST method

Why a POST Method? So we have the problem of plugins wanting to query the database, the current implementation uses URL parameters to specify the filters, which has posed some limitations, exposes sensitive data and makes querying complex.

A POST method hides sensitive information. A POST method may have a body in which we can then specify, the following JSON object.

@ColeDrain
ColeDrain / gist:dc644df46581ad28736d9f2d41c11de5
Last active September 13, 2021 12:48
Implementing Data Read as a Post Request
// Testing
type readDataRequest struct {
PluginID string `json:"plugin_id"`
CollectionName string `json:"collection_name"`
OrganizationID string `json:"organization_id"`
ObjectID *string `json:"object_id,omitempty"`
Filter map[string]interface{} `json:"filter"`
}
func NewRead(w http.ResponseWriter, r *http.Request) {