Commit Graph

230 Commits

Author SHA1 Message Date
ben-toogood
9813f98c8b
config: remove default config (#1882)
Co-authored-by: Asim Aslam <asim@aslam.me>
2020-07-28 13:54:58 +01:00
Asim Aslam
563768b58a
v3 refactor (#1868)
* Move to v3

Co-authored-by: Ben Toogood <bentoogood@gmail.com>
2020-07-27 13:22:00 +01:00
Asim Aslam
e082ac42a0 go fmt 2020-07-19 10:51:16 +01:00
Asim Aslam
0299517f0d remove config readme 2020-07-14 21:55:05 +01:00
Asim Aslam
e1404a1100 remove secrets package 2020-07-14 21:53:43 +01:00
Asim Aslam
057d61063f Move back command 2020-07-14 20:57:13 +01:00
Asim Aslam
0a79db498c
do not compare snapshot unless non nil (#1830) 2020-07-14 07:52:45 +01:00
ben-toogood
8fe4f1f2c3
config/cmd: don't fatally error if config can't be loaded (#1825)
* config/cmd: don't fatally error if config cannot be loaded

* config/cmd: fix log level typo
2020-07-13 15:08:53 +01:00
ben-toogood
2e04fcd718
config/cmd: don't fatally error if auth account cannot be generated (#1824) 2020-07-13 12:52:54 +01:00
ben-toogood
4e7621da18
config/cmd: standardise error handling (#1816)
* runtime/kubernetes: remove reference to runtime cells

* config/cmd: standardize error handling

Co-authored-by: Asim Aslam <asim@aslam.me>
2020-07-12 07:22:08 +01:00
ben-toogood
09ec20fded
runtime: provide credentials to services (#1817)
* runtime: inject credentials into service

* util/auth: self generate accounts (needed for jwt)

* runtime/kubernetes: add logging for creds

* runtime/kubernetes: serialize secret name

* runtime/kubernetes: remove unused code

* runtime/kubernetes: base64 encode secret

* runtime/kubernetes: remove metadata from secret

* util/kubernetes/client: omit empty secret metadata

* util/kubernetes/client: fix secret template

* util/kubernetes/client: fix secrets

* web: update auth util

* util/auth: fix missing arg

* extend token expiry

* extend token expiry
2020-07-10 16:25:46 +01:00
ben-toogood
318a80f824
config/cmd: improve cert loading for infra (#1813)
* config/cmd: improve cert loading for infra

* config/cmd: remove certificate_authorities flag

* config/cmd: fix caps

* config/cmd: fix bug with IsSet

* config/cmd: fix bool flags
2020-07-09 18:02:24 +01:00
ben-toogood
333320dcb8
config/cmd: secure broker (#1806)
* config/cmd: secure broker

* config/cmd: remove testing
2020-07-08 16:22:48 +01:00
ben-toogood
86f4235aaf
config/cmd: custom certificate authorities & secure registry (#1803)
* config/cmd: add registry_secure option

* config/cmd: tmp load ca

* config/cmd: tmp load ca

* config/cmd: refactor certificate_authorities setup

* config/cmd: improve usage
2020-07-08 08:50:08 +01:00
ben-toogood
f5ed7e5833
config/source/service: change default namespace to micro (#1798)
Co-authored-by: Asim Aslam <asim@aslam.me>
2020-07-07 08:19:52 +01:00
Colin Hoglund
90dca65f55
make environment variable interpolation preprocessor optional (#1715) 2020-07-06 20:13:35 +01:00
ben-toogood
c58ac35dfc
broker/service: use wrapped micro client to authenticate requests (#1782) 2020-07-02 17:54:53 +01:00
ben-toogood
d577dd6abe
config: add namespace support (#1780)
* config/cmd: use service namespace for config

* config/service: add namespace option to list
2020-07-02 14:07:58 +01:00
ben-toogood
174e44b846
Deprecate client/selector (#1767)
* client/{grpc,rpc}: depricate selector (wip)

* {client,cmd}: remove client/selector

* deprecate client/selector

* router/static: fix lookup

* config/cmd: add support for legacy static selector flag

* config/cmd: add support for legacy dns selector flag
2020-07-01 17:06:59 +01:00
ben-toogood
4f0f4326df
router: improve router configuration (#1745)
* router: update default address to :8084

* service: add router to service options

* config/cmd: improve router setup
2020-06-26 10:38:11 +01:00
ben-toogood
bc60f23ff6
config/cmd: setup registry before router (#1743) 2020-06-25 15:24:31 +01:00
ben-toogood
2b506b1a2a
auth/service: use address option since router may not be configured (#1734) 2020-06-24 13:47:43 +01:00
ben-toogood
a2550820d3
router: add to service options; add dns and static implementations (#1733)
* config/cmd: add router to service options

* router/service: use micro client
2020-06-24 11:46:51 +01:00
ben-toogood
2b889087bd
config/cmd: fix selector setup bug (#1723) 2020-06-19 13:11:48 +01:00
ben-toogood
c16f4b741c
server: register in the services namespace (#1718) 2020-06-19 09:24:32 +01:00
Colin Hoglund
83cecdb294
config: use configured reader by default (#1717) 2020-06-19 08:49:30 +01:00
ben-toogood
5fd36d6cc0
config/cmd: remove package duplicate initialization (#1711) 2020-06-18 10:14:04 +01:00
ben-toogood
9d3365c4be
auth: rename auth.Namespace to auth.Issuer (#1710) 2020-06-17 12:26:27 +01:00
sunfuze
2efb459c66
Fix config watch (#1670)
* add dirty overrite test case

* need version to figure out if config need update or not

* using nanosecond as version for two goroutine can run in same second

* config should check snapshot version when update

* set checksum of ChangeSet

Co-authored-by: Asim Aslam <asim@aslam.me>
2020-06-16 17:10:52 +01:00
Janos Dobronszki
00b76e0a64 Initialize selector before we make an auth.Generate call (#1693) 2020-06-12 10:42:52 +01:00
ben-toogood
74368026a5 Fix incorrect namespace variable name (merge conflict) (#1677) 2020-06-12 10:42:52 +01:00
ben-toogood
fde1aa9d6a Move auth account creation to config/cmd (#1676) 2020-06-12 10:42:52 +01:00
Ben Toogood
d85b4197b4 Return nil changeset and not blank 2020-05-27 12:20:31 +01:00
Ben Toogood
bb5f2e5525 Handle config service not found errors 2020-05-27 12:12:34 +01:00
Ben Toogood
5712cc9c62 Merge master 2020-05-26 15:52:21 +01:00
Ben Toogood
2729569f66 Add Debug.Cache method 2020-05-24 18:45:57 +01:00
Ben Toogood
7d7f4046e8 Client Cache 2020-05-22 16:52:24 +01:00
Ben Toogood
dc10f88c12 Replace auth account.Namespace with account.Scopes 2020-05-19 18:17:17 +01:00
Ben Toogood
83e9c1fad2 Remove unnecessary change 2020-05-14 13:32:42 +01:00
Ben Toogood
1b18730d54 Custom micro client 2020-05-14 11:25:19 +01:00
Ben Toogood
5764519f5b Refactor auth to load token outside wrappers 2020-05-14 11:06:22 +01:00
Ben Toogood
d39b723511 Auth Namespace Flag 2020-05-12 16:41:29 +01:00
Ben Toogood
efb64b7dbb Pass client to more of the runtime 2020-05-11 17:57:39 +01:00
Ben Toogood
f892b41299 Add runtime to service.Options() 2020-05-11 17:09:28 +01:00
Asim Aslam
b3915b6020
Add store to options (#1600) 2020-05-01 18:05:09 +01:00
Ben Toogood
669364985e JWT auth implementation 2020-04-29 09:21:17 +01:00
Asim Aslam
83ab47333f
rename Codec to Secrets (#1581) 2020-04-27 14:57:57 +01:00
268651df18
regenerate all proto based files (#1531)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-14 16:25:09 +03:00
bc71640fd9
broker: swap default broker from eats to http (#1524)
* broker: swap default broker from eats to http

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-11 03:46:54 +03:00
Asim Aslam
9a685b2df5
delete k8s registry (#1522) 2020-04-10 17:15:20 +01:00
1063b954de
dont display t.Log/t.Logf as errors in github actions (#1508)
* fix tests and github action annotations

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-04-09 14:05:46 +03:00
Asim Aslam
bf41d8d28e fix store table env var 2020-04-08 19:44:49 +01:00
Lars Lehtonen
900b2d24f9
config/secrets/box: fix dropped test error (#1494) 2020-04-06 23:09:42 +01:00
Jake Sanders
3324d140c0
Rename store Namespace / Prefix options to Database and Table (#1492)
* Rename Namespace to DB, Rename Prefix to table, Remove Suffix Option

* Rename options

* Rename options

* Add store_table option

* Table per service, not Database per service
2020-04-06 16:45:55 +01:00
Ben Toogood
dea2d7ab9f Fix go-micro auth wrapper init 2020-04-03 12:27:01 +01:00
Ben Toogood
d577c32563 Add back auth.PrivateKey 2020-04-01 17:17:40 +01:00
Ben Toogood
f7655b71ea Merge branch 'auth-interface-update' of https://github.com/micro/go-micro into auth-interface-update 2020-04-01 14:25:07 +01:00
Ben Toogood
8e4d9e1702 Further Refactoring 2020-04-01 14:25:00 +01:00
Asim Aslam
6c6c5359b1
Add options to config (#1450) 2020-03-31 17:13:21 +01:00
Ben Toogood
d659e435c6 Service => Service Auth 2020-03-31 12:44:34 +01:00
9e6db79860
regenerate all proto (#1440)
* 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
ben-toogood
329bd09f93
Fix Auth Init bug (#1424)
Co-authored-by: Ben Toogood <ben@micro.mu>
2020-03-26 18:09:51 +00:00
Jake Sanders
397a8638f4
Cockroach Store bugfix (#1401) 2020-03-24 17:16:38 +00:00
ben-toogood
fd664f4392
Auth load rules (#1397)
* WithRoles variadic args

* Load Rules

* Timer => Ticker

Co-authored-by: Ben Toogood <ben@micro.mu>
2020-03-24 13:48:37 +00:00
ben-toogood
e0e77f3983
Updated auth interface (#1384)
* Updated  auth interface

* Add Rule

* Remove Rule

* Return token from Renew

* Renew => Refresh

* Implement Tokens & Default Auth Implementation

* Change default auth to noop

* Change default auth to noop

* Move token.Token to auth.Token

* Remove Token from Account

* Auth service implementation

* Decode JWT locally

* Cookie for secret

* Move string to bottom of interface definition

* Depricate auth_exclude

* Update auth wrappers

* Update go.sum

Co-authored-by: Ben Toogood <ben@micro.mu>
2020-03-23 16:19:30 +00:00
cbb958def5
config: fix panic on multiple Close() (#1374)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-19 12:54:59 +03:00
60993e6275
config/source/service: base64 fix (#1345)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-03-13 21:44:55 +00:00
Asim Aslam
d8cfa7a295
add config to cmd (#1337)
* add config to cmd

* fix build
2020-03-12 18:47:40 +00:00
ben-toogood
47f1203e97
Add Config to service options (#1336)
Co-authored-by: Ben Toogood <ben@micro.mu>
Co-authored-by: Asim Aslam <asim@aslam.me>
2020-03-12 18:13:03 +00:00
Asim Aslam
be9c6141f5
delete options (#1333) 2020-03-12 09:05:09 +00:00
Asim Aslam
f55493993c
set namespace rather than key (#1331) 2020-03-11 22:31:24 +00:00
7b385bf163
minimize allocations in logger and tunnel code (#1323)
* 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
Jake Sanders
4125ae8d53
Add secrets interface to config/secrets (#1325)
* Interface for secrets

* Add secretbox secrets implementation

* Start working on box

* typo

* Add asymmetric encryption implementation

* go mod tidy

* Fix review comments

Co-authored-by: Asim Aslam <asim@aslam.me>
2020-03-10 22:52:06 +00:00
ben-toogood
9a7a65f05e
Auth Provider (#1309)
* auth provider mock interface

* Auth Provider Options

* Implement API Server Auth Package

* Add weh utils

* Add Login URL

* Auth Provider Options

* Add auth provider scope and setting token in cookie

* Remove auth_login_url flag

Co-authored-by: Asim Aslam <asim@aslam.me>
Co-authored-by: Ben Toogood <ben@micro.mu>
2020-03-07 11:06:57 +00:00
Lars Lehtonen
80f2bfd5d0
config: remove unused sep variable (#1262) 2020-02-26 08:25:33 +00:00
Asim Aslam
6aaaf54275
add MICRO_AUTH_TOKEN, parse token in wrapper, preload config and othe… (#1261)
* add MICRO_AUTH_TOKEN, parse token in wrapper, preload config and other things

* fix wrapper panic
2020-02-25 22:15:44 +00:00
Di Wu
603d37b135
Set option and cli args to the service profile (#1259) 2020-02-25 16:42:42 +00:00
ben-toogood
ffdf986aac
Refactor auth: add token and store implementations (#1230)
* Refactor auth: add token and memory implementations

* Fix typo

* Remove memory auth (implemented already by the store implementation), revert default to noop

* Add grpc header

* Global Config

* config/global => util/config

* Rename package to remove confict

* Tweak

* Improve Error Handling
2020-02-24 15:07:27 +00:00
117f56ebf7
prune util/log and user logger (#1237)
* 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
ben-toogood
e080ecb43a
Auth Improvements (#1195)
* Exclude Stats & Trace from Auth

* Update Excluded Endpoints Format

* Tweak Implementation
2020-02-13 14:07:14 +00:00
ben-toogood
4401c12e6c Auth Wrapper (#1174)
* Auth Wrapper

* Tweak cmd flag

* auth_excludes => auth_exclude

* Make Auth.Excludes variadic

* Use metadata.Get (passes through http and http2 it will go through various case formats)

* fix auth wrapper auth.Auth interface initialisation

Co-authored-by: Asim Aslam <asim@aslam.me>
2020-02-10 08:26:28 +00:00
Lars Lehtonen
ca1d0b94c3
config/cmd: remove 8 unused variables (#1175) 2020-02-08 11:19:10 +00:00
67acd9288b
config/source/cli: fix tests (#1179)
* config/source/cli: fix tests
* skip mdns test in travis

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-02-08 02:45:32 +03:00
0bf6c9fc08
config/source/cli: fix default flag value loading (#1178)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-02-08 02:14:34 +03:00
ben-toogood
bf747a86f4
Runtime (#1160)
* Add String to Runtime interface

* Setup Dynamic Runtime Configuration
2020-02-05 13:59:35 +00:00
ben-toogood
d621548120
Auth (#1147)
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
Asim Aslam
0be22c98c6 add tracing 2020-01-30 23:24:46 +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
Asim Aslam
a291af59c4
Merge pull request #1142 from micro/tracing
Fix null tracer bug
2020-01-30 07:55:58 +00:00
Ben Toogood
d9f12731e1 Fix null tracer bug 2020-01-30 07:53:31 +00:00
Asim Aslam
4a838a8210 Merge branch 'master' of ssh://github.com/micro/go-micro 2020-01-29 23:14:16 +00:00
Asim Aslam
5969cc358e nats-e => eats 2020-01-29 23:14:05 +00:00
Asim Aslam
9f1a7e1139
Merge pull request #1127 from Allenxuxu/master
handle Loader.Load  return value error
2020-01-29 22:44:29 +00:00
Asim Aslam
49b86c56e3 go fmt 2020-01-29 22:40:43 +00:00
Asim Aslam
de3c3b27b2
Merge pull request #1140 from micro/tracing
Tracing by Ben Toogood
2020-01-29 22:28:49 +00:00
Micro
62c067adcd Refactor debug/trace ready for Jaeger 2020-01-29 15:45:11 +00:00
Lars Lehtonen
895aa896bc
config/reader/json: remove unused newValue() 2020-01-28 11:38:55 -08:00
e6a34bcbe7 update micro/cli to urfave/cli/v2 and fix go-micro
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-01-25 15:57:08 +03:00
Asim Aslam
2b1844971c go fmt 2020-01-24 21:31:57 +00:00
Asim Aslam
1c19678d04 Update proto Service => Config 2020-01-23 11:37:54 +00:00