Commit Graph

73 Commits

Author SHA1 Message Date
0a15ae9b9d Move String method () 2020-04-01 23:27:15 +01:00
e1bc0f6288 replace strings for store prefix ()
Co-authored-by: ben-toogood <bentoogood@gmail.com>
2020-04-01 20:19:21 +01:00
9e6db79860 regenerate all proto ()
* regenerate all proto

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* regenerate from proto

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* regenerate from proto

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-30 21:58:32 +01:00
011a783a9e store/cockroach: fix dropped test errors ()
Co-authored-by: Asim Aslam <asim@aslam.me>
2020-03-27 10:15:37 +00:00
dff98355be Missing ; in SQL query 2020-03-24 23:49:09 +00:00
397a8638f4 Cockroach Store bugfix () 2020-03-24 17:16:38 +00:00
eb4d2ae6aa Remove useless variable from cockroach store () 2020-03-24 15:37:30 +00:00
914340585c Trim space from env variables () 2020-03-24 14:51:43 +00:00
4c6f68d537 Implement store read cache ()
* Implement store read cache

* Added cache tests and fixed a bug in memory store
2020-03-19 18:19:07 +00:00
c91bf7e9e7 [WIP] Store Sync ()
* Initial cache implementation

* Write queue implementation

* Accidentally started writing the storage sync service
2020-03-18 16:39:36 +00:00
638c219736 Cockroach store feature completion ()
* Start fixing cockroach store

* Add prefix, suffix, limit, offset for cockroachdb store
2020-03-17 16:15:23 +00:00
ab73127063 grpc client/server fixes ()
* grpc client/server fixes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-17 14:27:20 +03:00
247707f583 Return store.ErrNotFound if not found when calling over rpc ()
Co-authored-by: Ben Toogood <ben@micro.mu>
2020-03-16 10:30:56 +00:00
e803fb0855 Runtime hacks ()
* Add Args/Image to runtime

* remove the hacks
2020-03-13 18:39:59 +00:00
078dd4eb9b fix etcd ()
* fix etcd

* update go mod
2020-03-13 08:55:23 +00:00
1b4e881d74 Rewrite the store interface ()
* WIP store rewrite

* Fix memory store tests

* Store hard expiry times rather than duration!

* Clarify memory test

* Add limit to store interface

* Implement suffix option

* Don't return nils from noop store

* Fix syncmap

* Start fixing store service

* wip service and cache

* Use _ for special characters in cockroachdb namespace

* Improve cockroach namespace comment

* Use service name as default store namespace

* Fixes

* Implement Store Scope

* Start fixing etcd

* implement read and write with expiry and prefix

* Fix etcd tests

* Fix cockroach store

* Fix cloudflare interface

* Fix certmagic / cloudflare store

* comment lint

* cache isn't implemented yet

* Only prepare DB staements once

Co-authored-by: Ben Toogood <ben@micro.mu>
Co-authored-by: ben-toogood <bentoogood@gmail.com>
2020-03-12 13:41:30 +00:00
1ca4619506 return store.ErrNotFound () 2020-03-11 23:09:42 +00:00
7b385bf163 minimize allocations in logger and tunnel code ()
* logs alloc

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* fix allocs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* fix allocs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* tunnel allocs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* try to fix tunnel

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* cache cipher for send

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-11 17:55:39 +00:00
3f0c28a815 Expiration is actually a unix timestamp ()
* Expiration is actually a unix timestamp

* int -> int64
2020-03-03 18:15:50 +00:00
beb5e80e87 Fix nil pointer dereference () 2020-03-03 13:54:56 +00:00
eebd69c995 Change from renekroon/ttlcache to patrickmn/go-cache () 2020-03-03 13:35:49 +00:00
bc71989e2c int64 -> time.Duration () 2020-03-03 13:15:26 +00:00
f6102bde70 Add a cache to workers KV storage implementation ()
* cloudflare-cache

* go mod tidy
2020-03-02 18:14:25 +00:00
9200c70202 Replace validation error with regex for cockroach namespace ()
Co-authored-by: Asim Aslam <asim@aslam.me>
2020-03-01 22:09:06 +00:00
117f56ebf7 prune util/log and user logger ()
* prune util/log and user logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* plaintext logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* add newline

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-02-23 13:45:20 +00:00
d621548120 Auth ()
Implement the Auth interface, with JWT and service implementations.

* Update Auth Interface

* Define Auth Service Implementation

* Support Service Auth

* Add Auth Service Proto

* Remove erronious files

* Implement Auth Service Package

* Update Auth Interface

* Update Auth Interface. Add Validate, remove Add/Remove roles

* Make Revoke interface more explicit

* Refactor serializing and deserializing service accounts

* Fix srv name & update interface to be more explicit

* Require jwt public key for auth

* Rename Variables (Resource.ID => Resource.Name & ServiceAccount => Account)

* Implement JWT Auth Package

* Remove parent, add ID

* Update auth imports to v2. Add String() to auth interface
2020-02-03 08:16:02 +00:00
f23638c036 fix import paths for v2 release
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-01-30 14:44:40 +03:00
101017a29c cockroach supports URL connection string 2020-01-29 00:47:41 +08:00
6ca298c61d set default store, fix store options bug, add String method 2020-01-10 19:13:55 +00:00
a90a74c9e2 Change the store interface to remove variadic args () 2020-01-08 22:23:14 +00:00
048065fe96 support ability to set store, address and namespace via flags and env vars () 2020-01-08 12:11:31 +00:00
be6e8a7c78 add store to defaults () 2020-01-06 17:44:32 +00:00
55f5937c8b Remove debug 2019-12-16 17:16:10 +00:00
56619f2745 Fix cockroachdb store implemetation 2019-12-16 17:11:13 +00:00
303adca500 rename postgres to cockroach 2019-12-16 15:09:59 +00:00
59751c02e6 change store options 2019-12-16 14:38:51 +00:00
e8e112144f Create database should take the name of the database 2019-12-16 14:15:30 +00:00
0131e9468f change use of store namespace/prefix in sql store 2019-12-16 12:13:18 +00:00
d50f30d743 strip handlers 2019-12-10 11:46:13 +00:00
a1eaf9cc20 linting fixes
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2019-12-04 00:22:02 +03:00
8b63df7a98 regenerate the protos 2019-11-26 13:53:33 +00:00
64a251d69a improve the syncMap.Iterate test to make it 100% reproducible ()
* improve the syncMap.Iterate test to make it 100% reproducible

* rename store/mocks/Store.go

* rename mocks/store to mock/store
2019-11-23 14:13:17 +00:00
bdb62e8ed1 store/postgresql: fix dropped error () 2019-11-12 07:54:33 +00:00
5aa28dfb0d store/cloudflare: fix dropped error () 2019-11-09 15:18:51 +00:00
24b8d2a315 preallocating slices ()
* preallocated some slices when size is known

* gofmt

* gofmt
2019-11-04 10:33:53 +00:00
15e3b9b4c0 Let people connect with just a hostname 2019-11-01 15:16:05 +00:00
dee63b2b2c Implementation of postgres store 2019-11-01 14:13:21 +00:00
4db1e09798 change options to be trimmed down 2019-10-23 23:12:45 +01:00
232c8ac7a1 More cleanup of store cf 2019-10-23 23:10:44 +01:00
68d0efbeaa Move api types in cf store 2019-10-23 22:57:11 +01:00