Avoid locking around db requests by only locking around active requests
and always creating an active request if there is none. A nice side
effect of this is that if many parallel requests for remote media come
in (a common case) then only one database query is made for the duration
of the query.
* Add API for querying the state after a list of events
* Implement state after events API
* Actually implement the API
* Reorder .travis.yml
* Comments
* Use common.MakeAPI
Content-Disposition is only used for communicating the filename. It does
not need to be stored in the database as we have upload_name anyway. It
does not need to be in types.MediaMetadata and does not need to be
logged.
Reorder functions to have public API functions in alphabetical order at
the top, internal package functions at the bottom in call order.
Use RawURLEncoding to avoid padding the hash with '='.
Use stronger types for paths in public API.
Simplify comments.
* Start implementing the join room API
* Hacks to get join room working
* Make the TLS fingerprint configurable
* Fix the client API proxy to handle '#' correctly
* Return a 200 OK response
* Write the join event along with current state to the room server
* Comment on the error handling
* Fix typos
* Fix tab
* Add TODO for moving authEventIDs to gomatrixserverlib
* Comment on why we ignore the key ID argument for local keys
* Avoid 'preceeded'
* Neaten the control flow
* Neaten the control flow even more
* Return pointers
* Rename err to lastErr for the loop
- Renamed `clientapi/auth/types` to `clientapi/auth/authtypes` for the same
horrible namespace clashing reasons as `storage`.
- Factored out `makeAPI` to `common`.
- Added in `makeAuthAPI`.
Previously, all database stuff was under the helpfully named
package 'storage'. However, this convention is used throughout all
of dendrite, which will clash the moment we want to add auth to all
the CS API endpoints. To prevent the package name clash, add
sub-directories which represent what is being stored so the final
usage ends up being:
```
func doThing(db *storage.SyncServerDatabase, authDB *accounts.Database)
{
// ...
}
```
* Start implementing the federation server keys API.
* Fix copyright
* Fix comments
* Comment on the key format
* Better explain what the ValidityPeriod is
* Return a 200 status code
* Rename "make" to "makeAPI" and factor out some more common code into it
Naming a function the same as a go builtin function seems like a bad
idea. Also move the call to `NewJSONRequestHander` inside the function
rather than calling it everywhere.
* Fix typo