Code review impl.
diff --git a/api.go b/api.go index 3c50f99..b2b21f0 100644 --- a/api.go +++ b/api.go
@@ -15,8 +15,8 @@ Status string `json:"status"` Type string `json:"cType"` RedirectionURIs string `json:"redirectionURIs"` - AppId string `json:"cmpydevId"` - AppName string `json:"cmpydevAppName"` + AppId string `json:"appId"` + AppName string `json:"appName"` } type errResultDetail struct { @@ -114,7 +114,7 @@ c.issued_at, c.status, a.callback_url, - ad.name, + ad.email, ad.id, "developer" as ctype FROM @@ -161,10 +161,10 @@ AND c.tenant_id = $2) ;` - var status, redirectionURIs, cmpydevAppName, cmpydevId, resName, resEnv, cType string + var status, redirectionURIs, appName, appId, resName, resEnv, cType string var issuedAt int64 err := db.QueryRow(sSql, key, tenantId).Scan(&resName, &resEnv, &issuedAt, &status, - &redirectionURIs, &cmpydevAppName, &cmpydevId, &cType) + &redirectionURIs, &appName, &appId, &cType) switch { case err == sql.ErrNoRows: reason := "API Key verify failed for (" + key + ", " + scopeuuid + ", " + path + ")" @@ -207,8 +207,8 @@ Status: status, RedirectionURIs: redirectionURIs, Type: cType, - AppId: cmpydevId, - AppName: cmpydevAppName}, + AppId: appId, + AppName: appName}, } return json.Marshal(resp) }
diff --git a/apidVerifyAPIKey-api.yaml b/apidVerifyAPIKey-api.yaml index 4af4e20..b351771 100644 --- a/apidVerifyAPIKey-api.yaml +++ b/apidVerifyAPIKey-api.yaml
@@ -62,9 +62,9 @@ issuedAt: 1234567890 status: abc123 redirectionURIs: abc123 - AppName: abc123 - AppId: abc123 - Type: "developer" + appName: abc123 + appId: abc123 + cType: "developer" default: description: 4xx or 5xx errors schema: @@ -133,11 +133,11 @@ type: string redirectionURIs: type: string - AppName: + appName: type: string - AppId: + appId: type: string - Type: + cType: type: string example: type: "APIKeyContext" @@ -147,9 +147,9 @@ issuedAt: 1234567890 status: "abc123" redirectionURIs: "abc123" - AppName: "abc123" - AppId: "abc123" - Type: "company OR developer" + appName: "abc123" + appId: "abc123" + cType: "company OR developer" VerifyAPIKeyResponseFailed: allOf:
diff --git a/init.go b/init.go index 555d848..7a1ad38 100644 --- a/init.go +++ b/init.go
@@ -73,7 +73,6 @@ PRIMARY KEY (tenant_id, id)); CREATE TABLE IF NOT EXISTS developer ( id text, - name text, tenant_id text, username text, first_name text,
diff --git a/listener.go b/listener.go index 8952775..da921ab 100644 --- a/listener.go +++ b/listener.go
@@ -202,10 +202,10 @@ */ func insertDevelopers(rows []common.Row, txn *sql.Tx) bool { - var scope, EntityIdentifier, Email, Status, UserName, FirstName, LastName, tenantId, CreatedBy, LastModifiedBy, Username, Name string + var scope, EntityIdentifier, Email, Status, UserName, FirstName, LastName, tenantId, CreatedBy, LastModifiedBy, Username string var CreatedAt, LastModifiedAt int64 - prep, err := txn.Prepare("INSERT INTO DEVELOPER (_change_selector,email,id,tenant_id,status,username,first_name,last_name,name,created_at,created_by,updated_at,updated_by) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13);") + prep, err := txn.Prepare("INSERT INTO DEVELOPER (_change_selector,email,id,tenant_id,status,username,first_name,last_name,created_at,created_by,updated_at,updated_by) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12);") if err != nil { log.Error("INSERT DEVELOPER Failed: ", err) return false @@ -222,7 +222,6 @@ ele.Get("username", &Username) ele.Get("first_name", &FirstName) ele.Get("last_name", &LastName) - ele.Get("email", &Name) ele.Get("created_at", &CreatedAt) ele.Get("created_by", &CreatedBy) ele.Get("updated_at", &LastModifiedAt) @@ -242,7 +241,6 @@ UserName, FirstName, LastName, - Name, CreatedAt, CreatedBy, LastModifiedAt,