Commit graph

856 commits

Author SHA1 Message Date
Matthew Jaffee
04b13d9eb6 have test use the cluster.Start helper to avoid port conflicts
cluster.Start creates ephemeral ports for all the etcd stuff, whereas
node.Start uses the default config. I don't know why this test was
using the node.Start, but it passes without it.
2022-02-08 09:30:07 -06:00
Matthew Jaffee
6cc5d198ee remove unused stuff and fix a bunch of random staticcheck issues
sorry... once I saw, I couldn't unsee
2022-02-07 15:10:10 -06:00
reesporte
88d2914b15 fb1172: enable refresh tokens
- rip out gobby stuff
- add tokenCache, groupsCache
- refresh the token if needed
- set cookies after authenticate
- remove signature validation, the IDP does that for us
- added way more unit tests
- update older tests to use new API
- add fake idp to authcluster tests
2022-02-07 13:42:11 -06:00
reesporte
8097e7dffd update test 2022-02-04 16:26:56 -06:00
reesporte
1f8efd663c log index with query for grpc 2022-02-04 16:04:19 -06:00
Matthew Jaffee
254bacc40c remove http subpackage and bring implementations into core
remove interfaces as necessary
2022-02-03 21:04:04 -06:00
Souhaila Noor
bae9d16c4f updated the tests 2022-01-28 14:28:59 -06:00
Souhaila Noor
20871a8780 remove asserting for log path 2022-01-28 13:07:22 -06:00
Souhaila Noor
1a4acfe97d fix bug with query bug 2022-01-28 13:01:08 -06:00
reesporte
836df379ac add test coverage
for the following auth related packages:
* authn
* http
* server

fix minor bugs, do some cleaning up, etc in `authn/authenticate.go` and `http/handler.go`
2022-01-21 13:57:47 -06:00
Ben Johnson
9ebf0e2119 Upgrade go.mod to featurebase/v3 2022-01-21 10:57:05 -07:00
reese
647d62c8e7
Merge branch 'master' into grpc-logging 2022-01-20 15:51:21 -06:00
reesporte
81fcd9c228 fix merge conflicts 2022-01-20 14:14:25 -06:00
reesporte
9371212697 Merge branch 'master' into grpc-logging 2022-01-20 14:06:05 -06: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
reesporte
592fcbb05b one logger to rule them all
unify logging method, actually log query for streaming and unary requests
2022-01-19 21:20:08 -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
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
695321e6c0 print attr 2022-01-17 20:47:27 -06:00
Samir Patel
70b1ef906f switch on req type 2022-01-17 20:41:57 -06:00
reesporte
04a51a7819 remove shadowed ok
thanks golangci-lint
2022-01-15 12:25:09 -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
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
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
34393dee09 rip out rowcache
not strictly backward compatible... hopefully no one is actually using
the rowcache config option
2022-01-11 13:49:09 -06:00
reesporte
bebc54b4e2 fix file perms to be _actually_ 600
based on staticcheck results:
server/server.go:627:58: file mode '600' evaluates to 01130; did you mean '0600'? (SA9002)
server/server.go:632:65: file mode '600' evaluates to 01130; did you mean '0600'? (SA9002)
2022-01-07 09:30:11 -06:00
kcrodgers24
5dfca76fbb correct TLS enabled check 2022-01-06 09:29:03 -08:00
reesporte
8d6490329b Merge branch 'master' into protect-endpoints 2022-01-04 16:18:18 -06:00
Samir Patel
d537398568
Merge branch 'master' into 54mir/authentication 2022-01-03 23:33:45 -05:00
Fletcher Haynes
b9e8d3a103 Commented out a failing test as a meta-test 2022-01-03 19:17:11 -08:00
Samir Patel
a7fada30dd revisions 1 2022-01-03 20:43:51 -06:00
Samir Patel
7750900310 more logging 2021-12-29 13:18:42 -05:00
reesporte
be66103c45 requirements when auth is enabled
postgres binding is turned off
TLS must be turned on
2021-12-29 11:20:19 -06:00
reesporte
42f3557c55 fix merge conflicts 2021-12-29 09:05:53 -06:00
Travis
ffd91137e1
Stop blocking API called when cluster is DOWN or DEGRADED
This commit effectively removes the API-level validation that was
blocking certain API methods when the cluster was in a particular state
(namely DOWN and DEGRADED). The thinking is that we shouldn't be
blocking these requests at the API level, but rather should let them
pass through and allow the fact that a node is ACTUALLY down dictate the
behavior.

With this change, two tests were modified. They were previously
expecting the error message from the API validation on DOWN, but now
they check for a "shard unavailable" error, which is what gets returned
for a particular query when the cluster is in an unhealthy state.
2021-12-28 13:52:04 -06:00
Samir Patel
0ef67fd699 move query logger option to auth 2021-12-27 16:42:13 -05:00
Samir Patel
684c408b93 Merge branch '54mir/protect-endpoints' into queryLoggerSetup 2021-12-22 15:12:31 -06:00
rachithrr
5650a24c9b query logger is set up. 2021-12-21 16:52:22 -05:00
Samir Patel
fd7d905be2 fix formatting issues 2021-12-21 15:49:51 -06:00
Samir Patel
1c907281bf authz changes 2021-12-20 18:03:18 -06:00
Samir Patel
3b374a62bf Merge branch 'master' into 54mir/authentication 2021-12-20 16:42:11 -06:00
Samir Patel
6faa889bfb move logout url to conf 2021-12-20 14:30:19 -06:00
Samir Patel
e7f4eb1e36 response codes 2021-12-20 12:28:17 -06:00
Samir Patel
daeebf98eb more test cleanup 2021-12-20 09:43:30 -06:00
Samir Patel
67d438aab5 clean up 2021-12-20 01:29:11 -06:00
Samir Patel
0d52a952e0 resolve some comments 2021-12-19 23:33:44 -06:00
souhailanoor
e82088e086
Merge branch 'master' into fb1000 2021-12-19 11:38:08 -06:00
Souhaila Noor
c14bd08213 updated admin to be at the cluster level 2021-12-19 11:37:41 -06:00
Souhaila Noor
a606bd030a addressed reviewer's feedback 2021-12-17 16:46:07 -06:00