mirror of
https://github.com/optim-enterprises-bv/databunker.git
synced 2025-11-01 02:17:53 +00:00
use mode instead of type
This commit is contained in:
5
API.md
5
API.md
@@ -275,7 +275,10 @@ Fetch by user token:
|
|||||||
curl --header "X-Bunker-Token: $XTOKEN" -XGET \
|
curl --header "X-Bunker-Token: $XTOKEN" -XGET \
|
||||||
https://localhost:3000/v1/consent/email/test@paranoidguy.com
|
https://localhost:3000/v1/consent/email/test@paranoidguy.com
|
||||||
{"status":"ok","total":2,"rows":[
|
{"status":"ok","total":2,"rows":[
|
||||||
{"brief":"send-email-mailgun-on-login","message":"send-email-mailgun-on-login","status":"accept","token":"254d2abf-e927-bdcf-9cb2-f43c3cb7a8fa","type":"email","when":1576154130,"who":"test@paranoidguy.com"},{"brief":"send-sms-twilio-on-login","message":"send-sms-twilio-on-login","status":"accept","token":"254d2abf-e927-bdcf-9cb2-f43c3cb7a8fa","type":"phone","when":1576174683,"who":"4444"}]}
|
{"brief":"send-email-mailgun-on-login","message":"send-email-mailgun-on-login","status":"accept",
|
||||||
|
"token":"254d2abf-e927-bdcf-9cb2-f43c3cb7a8fa","mode":"email","when":1576154130,"who":"test@paranoidguy.com"},
|
||||||
|
{"brief":"send-sms-twilio-on-login","message":"send-sms-twilio-on-login","status":"accept",
|
||||||
|
"token":"254d2abf-e927-bdcf-9cb2-f43c3cb7a8fa","mode":"phone","when":1576174683,"who":"4444"}]}
|
||||||
```
|
```
|
||||||
|
|
||||||
### List granted
|
### List granted
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ import (
|
|||||||
type consentEvent struct {
|
type consentEvent struct {
|
||||||
When int32 `json:"when,omitempty" structs:"when"`
|
When int32 `json:"when,omitempty" structs:"when"`
|
||||||
Who string `json:"who,omitempty" structs:"who"`
|
Who string `json:"who,omitempty" structs:"who"`
|
||||||
Type string `json:"type,omitempty" structs:"type"`
|
Mode string `json:"mode,omitempty" structs:"mode"`
|
||||||
Token string `json:"token,omitempty" structs:"token"`
|
Token string `json:"token,omitempty" structs:"token"`
|
||||||
Brief string `json:"brief,omitempty" structs:"brief"`
|
Brief string `json:"brief,omitempty" structs:"brief"`
|
||||||
Message string `json:"message,omitempty" structs:"message"`
|
Message string `json:"message,omitempty" structs:"message"`
|
||||||
Status string `json:"status,omitempty" structs:"status"`
|
Status string `json:"status,omitempty" structs:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dbobj dbcon) createConsentRecord(userTOKEN string, usertype string, usercode string, brief string, message string, status string) {
|
func (dbobj dbcon) createConsentRecord(userTOKEN string, mode string, usercode string, brief string, message string, status string) {
|
||||||
now := int32(time.Now().Unix())
|
now := int32(time.Now().Unix())
|
||||||
// brief can not be too long, may be hash it ?
|
// brief can not be too long, may be hash it ?
|
||||||
if len(brief) > 64 {
|
if len(brief) > 64 {
|
||||||
@@ -47,7 +47,7 @@ func (dbobj dbcon) createConsentRecord(userTOKEN string, usertype string, userco
|
|||||||
When: now,
|
When: now,
|
||||||
Who: usercode,
|
Who: usercode,
|
||||||
Token: userTOKEN,
|
Token: userTOKEN,
|
||||||
Type: usertype,
|
Mode: mode,
|
||||||
Brief: brief,
|
Brief: brief,
|
||||||
Message: message,
|
Message: message,
|
||||||
Status: status,
|
Status: status,
|
||||||
|
|||||||
@@ -150,7 +150,7 @@
|
|||||||
}
|
}
|
||||||
var start = '<div class="d-flex flex-row bd-highlight mb-4">';
|
var start = '<div class="d-flex flex-row bd-highlight mb-4">';
|
||||||
var d = '<div class="p-2 bd-highlight">When: ' + dateFormat(row.when) + '</div>'
|
var d = '<div class="p-2 bd-highlight">When: ' + dateFormat(row.when) + '</div>'
|
||||||
var identity = '<div class="p-2 flex-fill bd-highlight">Identity: ' + row.who + ' (' + row.type + ')<br/>' + msg + '</div>'
|
var identity = '<div class="p-2 flex-fill bd-highlight">Identity: ' + row.who + ' (' + row.mode + ')<br/>' + msg + '</div>'
|
||||||
var cancel = "<a href=\"javascript:cancelThis('" + row.brief + "');\">cancel</a>";
|
var cancel = "<a href=\"javascript:cancelThis('" + row.brief + "');\">cancel</a>";
|
||||||
var accept = "<a href=\"javascript:acceptThis('" + row.brief + "');\">accept</a>";
|
var accept = "<a href=\"javascript:acceptThis('" + row.brief + "');\">accept</a>";
|
||||||
var op = cancel;
|
var op = cancel;
|
||||||
|
|||||||
Reference in New Issue
Block a user