Commit Graph

4864 Commits

Author SHA1 Message Date
Mike Arpaia
670aab219b Use crypto/rand instead of math/rand 2016-08-04 15:44:54 -07:00
Mike Arpaia
f2628b1715 Ascii art fyeah (#38) 2016-08-04 15:42:29 -07:00
Mike Arpaia
4687812f39 Sessions in MySQL (#37)
* Sessions in MySQL

* Reclaiming some names

* session renewal without new cookies on every request

* comments and docstrings

* light organization in vc generation

* go vet

* endpoints for session management

* Merging @zwass' commit with mine

* Updating salt generation to use crypt/rand

* use getRandomText for session keys

* VC no longer needs a DB or to return an error

* getRandomText docstring

* Only use session via the SessionBackend API

* Set session backend with the request, similar to db
2016-08-04 15:38:13 -07:00
Jason Meller
d9f776c756 Use Godep to vendor in all dependencies (#40)
This commit vendors in all of our dependencies using
[GoDep](https://github.com/tools/godep). We are forgoing using a vendor/ folder to avoid checking in deps into the repo.

Note: Never manually modify `Godeps/Godeps.json` this file is dynamically
by the godep CLI

Common Actions:

To add a new package foo/bar, do this:

1. Run `go get foo/bar`
1. Edit your code to import foo/bar.
1. Run `godep save` (or `godep save ./...`).

To update a package from your `$GOPATH`, do this:

1. Run `go get -u foo/bar`
1. Run `godep update foo/bar`. (You can use the `...` wildcard, for example
`godep update foo/...`).
2016-08-04 16:57:22 -04:00
Zachary Wasserman
5c349a458d Eliminate DB globals + refactor tests (#39)
* Eliminate global DB connections. Instead, one connection is established (with the underlying object supporting pooling) and passed through the gin.Context. This allows test/prod to inject the appropriate DB object into the context.
* Refactor tests appropriately for this new style of DB connection
* Fix a bug in the routing caught by refactoring of tests
2016-08-04 11:41:47 -07:00
Jason Meller
5ad7c07e0c Dockerize app (#32)
This commit adds both a Dockerfile and updates the docker-compose.yml with local mounting so that you can standup a consistent dev environment. Please view the project README for more information.
2016-08-04 11:41:18 -04:00
Zachary Wasserman
6fa2413363 Add logging and convenience methods (#34)
* Add request logging.
* Catch/log panic in request handlers.
* Add `mustGetDB` method that gets a DB connection or panics. This can simplify
  boilerplate in handlers.
* Consolidate `file` and `line` in logged fields to `location`.
* Set default log level to `WarnLevel`.
* Log a warning when Kolide is started with the example config.
* Turn on DB logging in debug mode.
2016-08-03 08:01:59 -07:00
Mike Arpaia
24638413c4 Endpoint integration tests (#28)
* Quick fix where JWTRenewalMiddleware wasn't saving the update session to the client

* integration tests for all user/account management HTTP endpoints

close #15

* Combine checks in CheckUser

* Moving t.Fatals into utility functions

* Simplifying get user by id or username flow

* Fixing incorrect error log message

* Simplifying checkUser compare
2016-08-02 15:39:20 -07:00
Mike Arpaia
fc1b8eaa05 Add bootup output to reflect that kolide binary is serving (#29)
Example output:

```bash
$ kolide-ose serve
=> kolide 0.1.0 application starting on https://:8080
=> Run `kolide help serve` for more startup options
Use Ctrl-C to stop

time="2016-08-02T14:25:02-07:00" level=info msg="some info logs!"
file=proc.go func=runtime.main line=188
time="2016-08-02T14:25:02-07:00" level=error msg="some error logs :("
file=proc.go func=runtime.main line=188
```

close #26
2016-08-02 14:42:37 -07:00
Mike Arpaia
c802a2dbc0 Cleaning up the salt generation function (#30)
close #19
2016-08-02 14:41:50 -07:00
Zachary Wasserman
82968a9430 Add configs + documentation for testing with dockerized osqueryd (#22) 2016-08-02 12:09:30 -07:00
Mike Arpaia
b74c2c52e8 Add drone.io badge to the README (#21)
close #18
2016-08-01 16:44:08 -07:00
Mike Arpaia
eee370e127 Authentication, authorization and user management (#10) 2016-08-01 16:32:20 -07:00
Mike Arpaia
91e78d276f Initial commit 2016-07-28 18:34:26 -04:00