Commit Graph

6 Commits (22ffe7542210f1e7d8d886ea7c3a135a9145cdb4)

Author SHA1 Message Date
Joey Hines 22ffe75422
Added API token handling
+ Tokens can be added by the add_token command or via the CLI
+ Tokens are checked for authorization before a command is run
+ Added an error message field to the GeoffreyApiResponse
+ Made tokens strings instead of u64s
  + Tokens are randomly generated 64 char long alphanumeric strings
+ Clippy + Fmt
2021-10-31 11:00:07 -06:00
Joey Hines b79db6029e
Fmt + Clippy 2021-10-24 13:21:30 -06:00
Joey Hines 8e6b652d5e
Added user_id checking to commands
+ Refactored to make CommandRequest a trait that all the parameter structs implment
+ Created handle_command to handle all the preprocessing needed before running the command
2021-10-24 13:20:15 -06:00
Joey Hines c57738349b
Cargo + Clippy
* Also discovered you can implement From<T> outside in modules outside whereT was declared
2021-10-17 12:24:45 -06:00
Joey Hines c2bc16f3d8
Added better error handling for API+Database
+ GeoffreyDatabaseError implements Into<GeoffreyApiError>
+ The database Option and Result were combined into just Result to reduce complexity
2021-10-17 12:21:01 -06:00
Joey Hines b92308da67
First pass of an API
+ Implemented register, find, and add_location
+ Bunch of changes to the DB and the Models to make this work
+ API models are defined in GeoffreyModels so things that call the API don't need to define their own types
+ Still needs a lot of work, and need to design the api a bit more
+ Clippy + fmt
2021-10-03 14:03:32 -06:00