Commit graph

8725 commits

Author SHA1 Message Date
reese
efb5be8a67
Merge pull request #1878 from molecula/redirect-url
add a redirect-base-url config option
2022-01-20 15:51:00 -06:00
reesporte
399a11223f use aws to run these jobs 2022-01-20 13:58:18 -06:00
reese
2e0aaa27a9
Merge branch 'master' into redirect-url 2022-01-20 13:08:16 -06:00
Samir Patel
164c69bdf2
Merge pull request #1874 from molecula/keygen
update keygen subcommand
2022-01-20 13:19:09 -05:00
reesporte
87bbca938c add a redirect-base-url config option
this allows the user to configure a url for their IDP to redirect to, rather
than relying on the bind address of the featurebase server itself
2022-01-20 12:09:18 -06:00
Samir Patel
dcdc90b961
Merge branch 'master' into keygen 2022-01-20 01:12:45 -05:00
reese
06ed22ef93
Merge pull request #1877 from molecula/fb1167
fix bug with nil elements in protobuf indexes
2022-01-19 21:13:03 -06:00
reese
35343db29a
Merge branch 'master' into fb1167 2022-01-19 19:08:11 -06:00
seebs
ffbf55ee40
Merge pull request #1860 from molecula/rbfPages
RBF page/cursor management improvements
2022-01-19 18:27:52 -06:00
Seebs
fb11895985 oops handle nil 2022-01-19 17:09:57 -06:00
Seebs
749dcd6970 retry on etcd timeout errors 2022-01-19 16:57:47 -06:00
Samir Patel
16eff203ec
Merge branch 'master' into keygen 2022-01-19 16:38:31 -05:00
Seebs
2dce518a24 retry other etcd ErrTimeout variants
etcd can return more detailed ErrTimeout variants in rare cases, and we
want to retry on those too.
2022-01-19 15:19:45 -06:00
Seebs
37507db4ac use array containers instead of individual bitwise adds
This affects TestTx_Remove, TestTx_DeallocateToFreeList, and
TestTx_RecreateBitmap, all of which were adding hundreds of thousands
of individual bits, or more, and all of which work just as well and
produce the same behavior using largeish containers.

This reduces race-detector-test runtime from about 20 minutes to
a couple.
2022-01-19 15:19:45 -06:00
Seebs
719a30e128 shorten MultiTx test
The MultiTx test runs for a fairly long time but doesn't add much
value running that much longer, and there's no reason it should take
more than half the time we spend on this entire directory.
2022-01-19 15:19:45 -06:00
Seebs
112abcb549 use stable cursor for freelist operations
The Cursor datatype is quite large, and allocating them constantly for
ops is extremely expensive. To avoid this, we create a single stable cursor
that lives in the DB, and can be used for freelist modifications. Since the
freelist is only ever modified once at a time, this should be safe. We also
don't fully zero it between operations, we just reset the relevant parts.
2022-01-19 15:19:45 -06:00
Seebs
adcd5adb02 improve the sync.Pool used for pages, avoid excess page allocations for WAL
Several changes. One is, we don't provide a `New` for pagePool, which
allows allocPage to check whether a page was returned, and thus, zero
pages which were found in the pool, or make new pages, but never zero
pages it just created with make. We then also make many more things
which were making pages use the pool.

Reuse the same page allocation for multiple header pages dumped into
the WAL; the bitmap header pages aren't stashed in our page map,
they're only written to the disk, so we don't need to make a new page
each time, we can just make one new page for the whole batch.

Internally in the pool, we pool pointers to [PageSize]byte, rather
than slices. sync.Pool needs pointer-like things. To store a pointer
to a slice, you have to heap-allocate the slice, also. So, instead
of heap-allocating copies of these slices, we just use pointers to
the raw data.
2022-01-19 15:19:45 -06:00
reesporte
a162322fc9 fix bug with nil elements in protobuf indexes
we were allocating space we weren't using smh my head
2022-01-19 14:53:35 -06:00
reese
49972939ec
Merge pull request #1876 from molecula/fb1166
fix bug where drop table wasn't being authorized
2022-01-19 14:26:04 -06:00
reesporte
61ef1aee4e fix older tests 2022-01-19 12:55:07 -06:00
reesporte
e7552a76a7 fix bug where drop table wasn't being authorized
also fixes bug in GetAuthorizedIndexList where perms weren't being properly compared
2022-01-19 12:08:05 -06:00
Samir Patel
e1d7389893
Update ctl/keygen.go
Co-authored-by: reese <45641995+reesporte@users.noreply.github.com>
2022-01-19 11:23:02 -05:00
Samir Patel
950e62aae9 update keygen subcommand
this updates the subcommand to output a single secret key
instead of two reflecting changes made to AuthN/authZ
2022-01-19 10:11:19 -06:00
reese
8834d211af
Merge pull request #1872 from molecula/build-lattice-improvements
actually be able to generate-statik
2022-01-18 15:43:30 -06:00
reesporte
fdf7b4107a actually be able to generate-statik
these were the changes i had to make to be able to build lattice on my machine
2022-01-18 12:14:54 -06:00
Matthew Jaffee
50f798cb18
Merge pull request #1870 from molecula/gitlab-ci-parity
add race and shardwidth22 tests to gitlab
2022-01-17 20:43:57 -06:00
Matthew Jaffee
8b5fdf40fc
Merge branch 'master' into gitlab-ci-parity 2022-01-17 16:35:50 -06:00
Matthew Jaffee
22a60a19f8
Merge pull request #1869 from molecula/qol-tweak
clean up files generated by tests
2022-01-17 16:35:24 -06:00
Matthew Jaffee
a16fee5f88 set shardWidth properly in client
the shardwidth22 tests were broken client side, but we didn't realize
this because we weren't running the client side tests since moving the
client code into the main FB repo until recently (woops), and more
recently, we'd stopped running the shardwidth22 tests in the move to
Gitlab, so when we re-enabled them we finally noticed that they were
broken in the client.

All this change does is takes the shardWidth value from the core
featurebase package instead of using a hardcoded value in the client package.
2022-01-17 10:57:01 -06:00
Matthew Jaffee
da03e3fad2 add race and shardwidth22 to Gitlab CI, cleanup
our coverage reporting was a bit wonky and had files coming from both
test and test-future... made everything come from future
2022-01-17 10:12:40 -06:00
Matthew Jaffee
e297a6775d have simulacradata tests clean up generated files 2022-01-17 09:39:28 -06:00
reese
80f9ddaa02
Merge pull request #1868 from molecula/security-logging
FB1109: authn/z audit logging
2022-01-15 12:43:32 -06:00
reesporte
04a51a7819 remove shadowed ok
thanks golangci-lint
2022-01-15 12:25:09 -06:00
reesporte
50f9b0d1b6 Merge branch 'master' into security-logging 2022-01-15 12:21:38 -06:00
reesporte
7644922406 adds logging to all network requests
addresses ticket FB-1109:
when auth is turned on, we log:
- source ip (if available)
- user-agent
- user id
- user name
- query string
- request endpoint

also adds some minor tweaks and comments  to chkAuthZ flow
2022-01-15 12:21:27 -06:00
Matthew Jaffee
231a395138
Merge pull request #1867 from molecula/external-lookup-gitlab
get external-lookup tests running in Gitlab CI
2022-01-15 08:13:10 -06:00
Matthew Jaffee
d5bd031451 better error reporting if delete fails 2022-01-14 21:09:16 -06:00
Matthew Jaffee
a08560d01e get external-lookup tests running in Gitlab CI
I was going to write a docker-compose thing for this to run postgres
alongside the Go tests, but then saw that Gilab has this handy-dandy
notion of a service, so used that.
2022-01-14 21:09:16 -06:00
reese
f9c7ff3629
Merge pull request #1866 from molecula/fb1130
[fb-1130]: filter http response and lockdown endpoints
2022-01-14 17:45:51 -06:00
reesporte
3fdf4e2d8b Merge branch 'master' into fb1130 2022-01-14 16:06:45 -06:00
reesporte
baf02748be filter http response and lockdown endpoints
- fixes required permissions on some http endpoints
- filters http endpoints:
    - /ui/usage
    - /schema
    - /schema/details
- filter GRPC show tables, fields
- allow admins to do anything
2022-01-14 16:05:54 -06:00
Matthew Jaffee
34c64fbaba
Merge pull request #1865 from molecula/wrapping-etcd-retry
add wrapping to differentiate etcd errors
2022-01-14 15:58:56 -06:00
Matthew Jaffee
555d185929 add wrapping to differentiate etcd errors
we had a CI job fail in an interesting way, but can't tell if the
etcd retrying stuff is working, so adding in this wrapping so we can
better differentiate the errors if we see it again.

Job is here: https://gitlab.com/molecula/featurebase/-/jobs/1977060827

Failure is:

```
=== RUN   TestClusterStuff
    cluster_test.go:36: creating index: against http://pilosa2:10101/index/testidx 404 Not Found: 'creating index: sending CreateIndex message: executing request: against http://pilosa3:10101/internal/cluster/message 500 Internal Server Error: 'processing message: getting index: testidx: etcdserver: request timed out
        ''
--- FAIL: TestClusterStuff (8.85s)
```
2022-01-14 14:01:37 -06:00
reese
605da1e074
Merge pull request #1861 from molecula/bearer-conversion-squashed
[fb-998] [fb-1131] [fb-1129] addresses multiple authn/z tickets
2022-01-14 13:52:24 -06:00
reesporte
89567b791b Merge branch 'master' into bearer-conversion-squashed 2022-01-14 12:34:22 -06:00
Matthew Jaffee
b2afe7ad3b
Merge pull request #1863 from molecula/moar-cicd-clustertests
add clustertests to gitlab CI
2022-01-14 12:32:40 -06:00
reesporte
9f37cf7b48 Merge branch 'master' into bearer-conversion-squashed 2022-01-14 12:32:06 -06:00
reesporte
cf2410fea6 addresses multiple authn/z tickets
* fb-998 - authn/z enabled in handlers (kitchen-sink ticket)
    - authorization is enabled through the use of a bearer token (using header "Authorization")
    - authorization may occur through the use of an "Authorization" header or "molecula-chip" cookie
    - ui is updated for changes to handler
* fb-1131 - protect grpc endpoints
    - GRPC endpoints now check authorization if auth is enabled
* fb-1129 - inter-node communication
    - the following endpoints use the secretKey for authentication:
        - /internal/cluster/message: POST
        - /internal/translate/data: GET, POST

* added test to api_test.go (TestAuth_MultiNode) testing various auth/permissions stuff on a multi-node cluster

not included:
    - fb-1130 - filter response of endpoints
    - fb-1109 - improved audit logging

@jaffee [are you not entertained](https://www.youtube.com/watch?v=mutgotxrcqg)

Co-authored-by: souhailanoor <90720110+souhailanoor@users.noreply.github.com>
Co-authored-by: tgruben <tgruben@gmail.com>
Co-authored-by: 54mir <48686912+54mir@users.noreply.github.com>
Co-authored-by: kcrodgers24 <49999391+kcrodgers24@users.noreply.github.com>
2022-01-14 12:31:32 -06:00
Matthew Jaffee
2f30bcda45 add clustertests to gitlab CI
had to install some dependencies and things on the runner which are
detailed in a comment.
2022-01-14 11:05:41 -06:00
pokeeffe-molecula
f6c458b093
Merge pull request #1862 from molecula/cicd-smoketest
Now with working integration testting
2022-01-13 15:27:17 -06:00