Progress on #2, #5; oauth isn't working but not far off

Using the Noir session doesn't seem to be the right thing to do. I should be using the Ring session, but I'm having a hard time getting my head round it. @yogthos is too bloody clever!
This commit is contained in:
Simon Brooke 2018-06-29 17:14:55 +01:00
parent 88468461fd
commit 4e296537c4
52 changed files with 465 additions and 114 deletions

View file

@ -1,7 +1,7 @@
------------------------------------------------------------------------
-- File queries.sql
--
-- autogenerated by adl.to-hugsql-queries at 2018-06-29T10:10:58.177Z
-- autogenerated by adl.to-hugsql-queries at 2018-06-29T14:15:37.324Z
--
-- See [Application Description
-- Language](https://github.com/simon-brooke/adl).
@ -27,8 +27,18 @@ returning id
-- :name create-authority! :! :n
-- :doc creates a new authority record
INSERT INTO authorities (id)
VALUES (:id)
INSERT INTO authorities (request_token_uri,
access_token_uri,
authorize_uri,
consumer_key,
consumer_secret,
id)
VALUES (:request_token_uri,
:access_token_uri,
:authorize_uri,
:consumer_key,
:consumer_secret,
:id)
returning id
-- :name create-canvasser! :! :n
@ -121,10 +131,12 @@ returning id
-- :doc creates a new intention record
INSERT INTO intentions (visit_id,
elector_id,
option_id)
option_id,
locality)
VALUES (:visit_id,
:elector_id,
:option_id)
:option_id,
:locality)
returning Id
-- :name create-issue! :! :n
@ -747,6 +759,11 @@ ORDER BY lv_addresses.address,
-- :doc selects existing authority records having any string field matching the parameter of the same name by substring match
SELECT * FROM lv_authorities
WHERE false
--~ (if (:request-token-uri params) "OR request_token_uri LIKE '%:request-token-uri%'")
--~ (if (:access-token-uri params) "OR access_token_uri LIKE '%:access-token-uri%'")
--~ (if (:authorize-uri params) "OR authorize_uri LIKE '%:authorize-uri%'")
--~ (if (:consumer-key params) "OR consumer_key LIKE '%:consumer-key%'")
--~ (if (:consumer-secret params) "OR consumer_secret LIKE '%:consumer-secret%'")
--~ (if (:id params) "OR id LIKE '%:id%'")
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
@ -868,6 +885,7 @@ WHERE false
--~ (if (:visit_id params) "OR visit_id = :visit_id")
--~ (if (:elector_id params) "OR elector_id = :elector_id")
--~ (if (:option_id params) "OR option_id = :option_id")
--~ (if (:locality params) "OR locality = :locality")
--~ (if (:Id params) "OR Id = :Id")
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
@ -941,6 +959,17 @@ SET address = :address,
locality = :locality
WHERE addresses.id = :id
-- :name update-authority! :! :n
-- :doc updates an existing authority record
UPDATE authorities
SET request_token_uri = :request-token-uri,
access_token_uri = :access-token-uri,
authorize_uri = :authorize-uri,
consumer_key = :consumer-key,
consumer_secret = :consumer-secret,
id = :id
WHERE authorities.id = :id
-- :name update-canvasser! :! :n
-- :doc updates an existing canvasser record
UPDATE canvassers
@ -1001,7 +1030,8 @@ WHERE followuprequests.id = :id
UPDATE intentions
SET visit_id = :visit_id,
elector_id = :elector_id,
option_id = :option_id
option_id = :option_id,
locality = :locality
WHERE intentions.Id = :Id
-- :name update-issue! :! :n