* Define session database schema
* Update comments
* Add insert trigger for session state
* Add canceling state and update foreign keys to 'set null' on delete
* Adding new style template starts.
* Host-set crud changes generated and tested.
* Add templates for every resource with the new pathing. Only host-sets has testing or the backed pathing.
* Only generate new style API if requested in the input. Have disabling old be opt in.
This updates the command to our emergent standards. It also enables
using a separate config file for a config kms, which allows non-string
values to be encrypted.
This allowed some nice cleanup as well.
* Shave off an IAM lookup if the user is the anonymous user
* Fix build
* If authz failures are turned off, make the token type unknown instead of invalid
* Change returned token format when authz failures are disabled
* Change logic back
* Fix logic
This is useful if you, for instance, want Terraform to be 100%
responsible for creation of resources (outside of the static ones that
cannot be removed or modified, like u_anon). This will mean using the
recovery mechanism for initial setup, but that isn't an issue once TF
supports that :-)
* Update host set member test
* Add ListSetMembers method signature and doc
* Move repository methods for host set members to new file
* Add TestSetMembers
* Implement ListSetMembers
* Return hosts from ListSetMembers
* Implement AddSetMembers
* Implement DeleteSetMembers
* Use sql.QueryContext not sql.Query
* Implement SetSetMembers
* Refactor: extract getHosts method
* Refactor: extract createMembers method
* Refactor: extract common functions
* Return correct count of changed
In SetSetMembers, retrieving the current list of hosts in the set
happens after the transaction to modify the set has completed. This
retrieval can result in an error but the number of modified rows is not
effected.
* Make list set members an unexported method
* Get hosts within the same transaction as mutations of the set
* Return hosts of set from LookupSet method
* Return hosts of set from UpdateSet method
* Remove listSetMembers
* Fix merge conflict
* Add NOTE and TODOs about using new pattern in "SetMembers" methods
* Encrypt tokens on the way out and decrypt on the way in
This isn't a security feature related to tokens specifically; it's so
that we can discard cryptographically bad tokens before we ever hit the
DB. This way we can't pass through a DDoS to the database due to
fetching obviously invalid token values.
I'm using base58 to encode the resulting value as there aren't great
base62 options, and allowing base64 / and + values can hamper usability
by creating copying/highlighting breaks.