Commit Graph

76 Commits

Author SHA1 Message Date
Elena Kolevska 106329e583
Mutexmap (#95)
* Adds Mutex Map

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Adds an atomic map

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* More work on atomic map and mutex map

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Fixes, improvements and more tests

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Updates interface

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Linter

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Refactors atomic map to use generics

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* cleanups

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Apply suggestions from code review

Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Signed-off-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>

* small reorg

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Adds ItemCount()

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Removes atomicmap in favour of haxmap

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* formats fix and adds comment

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Update concurrency/mutexmap.go

Co-authored-by: Josh van Leeuwen <me@joshvanl.dev>
Signed-off-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>

* Uses built in `clear`

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Revert "Removes atomicmap in favour of haxmap"

This reverts commit 20ca9ad197.

Signed-off-by: Elena Kolevska <elena@kolevska.com>

* Uses clear() for atomic map too

Signed-off-by: Elena Kolevska <elena@kolevska.com>

---------

Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>
Co-authored-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: Josh van Leeuwen <me@joshvanl.dev>
2024-05-23 15:57:05 -07:00
Annu Singh ccffb60016
fixing a dead hyperlink (#94)
Signed-off-by: Annu Singh <annu.singh@terramate.io>
2024-04-16 13:28:40 -07:00
Josh van Leeuwen a3f906d609
Adds crypto/spiffe (#92)
* Adds crypto/spiffe

Adds spiffe package to crypto. This is a refactored version of the
existing `pkg/security` package. This new package is more modulated and
fuller test coverage.

This package has been moved so that it can be both imported by dapr &
components-contrib, as well as making the package more suitable for
further development to support X.509 Component auth.
https://github.com/dapr/proposals/pull/51

Also moves in `test/utils` from dapr to `crypto/test` for shared usage.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Adds crypto/spiffe/context

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
2024-04-15 10:19:26 -07:00
lee 0c7cfce53d
Add placement error code (#91)
Signed-off-by: Lee Fowler <fowler.lee8@gmail.com>
2024-04-02 13:38:09 +03:00
Josh van Leeuwen 6c3b2ee1ef
Events: type Batcher value & ensure queue order (#89)
* Events: type Batcher value & ensure queue order

Update Batcher to allow for typed value types.

Update Batcher and Queue to execute values in order they were added.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Delay batcher to ensure key is sent in order

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
2024-03-26 13:31:51 +02:00
Sam e33fbab745
feat: enable original key to be returned for metadata property fields (#88)
Signed-off-by: Samantha Coyle <sam@diagrid.io>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2024-03-06 07:26:01 -08:00
Mike Nguyen 050e34c9b9
chore: bump lestrrat-go/jwx/v2 from v2.0.15 to v2.0.20 (#86)
Signed-off-by: mikeee <hey@mike.ee>
2024-02-26 09:24:31 -08:00
Chaitanya Bhangale 9e733a35f1
Add cryptography error code (#84)
Co-authored-by: Chaitanya Bhangale <chaitanyabhangale@Chaitanyas-MacBook-Pro-2.local>
2024-02-19 13:42:03 -08:00
Josh van Leeuwen 858719eb78
Change `events/batcher` to use `events/queue` as backend. (#82)
* events/batcher: use events/queue as queue backend

Signed-off-by: joshvanl <me@joshvanl.dev>

* Make events/queue/queue key type comparable

Signed-off-by: joshvanl <me@joshvanl.dev>

* Explicitly define NewProcessor generic type in test

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
2024-01-15 09:08:33 -08:00
Alessandro (Ale) Segala c24d1d28cf
JWKSCache: add option to set CA certificate to trust (#81)
This is helpful when the JWKS is located on a HTTPS endpoint and the certificate is signed by a custom CA.

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2024-01-11 10:59:16 -08:00
Alessandro (Ale) Segala 77f7f031c9
Add `ttlcache` package (#80)
* Add `ttlcache` package

This implements an in-memory cache with a TTL for automatically expiring records

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Add delete method

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-12-27 07:25:56 -08:00
Elena Kolevska abe711ef62
Updates path in README.md (#79)
Signed-off-by: Elena Kolevska <elena-kolevska@users.noreply.github.com>
2023-12-20 08:21:41 -08:00
Cassie Coyle fd317d255e
Add `errors` package (#77)
* Move dapr/concurrency to kit (#72)

* Move dapr/concurrency to kit

Does not include any code change

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Fixed copyright year

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Improved memory usage in error collection

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Move `pkg/signals` from dapr/dapr to kit (#70)

No code changes

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Move dapr/utils/streams to kit (#68)

* Move dapr/utils/streams to kit

No code changes

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* 💄

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Lint

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Migrate metadata decoder from components-contrib to kit (#74)

* Migrate metadata decoder from components-contrib to kit

Required creating the `utils` package for utils.IsTruthy too (ported from runtime)

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Lint

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* initial standardized err pkg: errfmt

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* tweaks to error pkg and update tests. need to confirm reason

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* cleanup test

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add new func for err. change to protojson for http. need to figure out grpc status tho

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* update status name

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* wip: update JSONErrorValue

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Updates err to json conversion. Organises error messages and codes

Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add type to http json output. tests are a WIP

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add all details, update tests, prefixes/postfixes

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add README

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* use strongly-typed struct for errJSON

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* update README

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Adds the option to add a help link detail and a field violation detail

Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Update fswatcher to use /events/batcher (#75)

* Update fswatcher to use /events/batcher

Signed-off-by: joshvanl <me@joshvanl.dev>

* Linting

Signed-off-by: joshvanl <me@joshvanl.dev>

* Linting

Signed-off-by: joshvanl <me@joshvanl.dev>

* Add sleep to wait for windows fsnotify to become ready

Signed-off-by: joshvanl <me@joshvanl.dev>

* Increase time for event to be received to 1 second

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Adds tests for WithHelp and err.WithFieldViolation

Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rebase and update proto field access to rebased code

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* gofumpt

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* errJson -> errJSON and update proto field access

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* HttpCode -> HTTPCode per CI warnings

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rm reason since its not used

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* update return type in README example

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* use builder, add errorInfo check to Build(), update and add tests for new funcs, add getters for grpc/http codes

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* appease CI

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* update README

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* make GRPCStatus val receiver

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Update messages.go

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* add test to ensure we have a switch for all google err_detail types

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rebase and update log

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* re-export ErrorBuilder

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Update errors/errors.go

Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Cassie Coyle <cassie.i.coyle@gmail.com>

* use ast pkg to dynamically grab our errTypes in the switch case instead of hard coding it

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* appease CI

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* add FromError func

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* account for error wrapping

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

---------

Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: Cassie Coyle <cassie.i.coyle@gmail.com>
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Elena Kolevska <elena@kolevska.com>
Co-authored-by: Josh van Leeuwen <me@joshvanl.dev>
2023-12-19 08:42:36 -08:00
Josh van Leeuwen df64d3a144
Update fswatcher to use /events/batcher (#75)
* Update fswatcher to use /events/batcher

Signed-off-by: joshvanl <me@joshvanl.dev>

* Linting

Signed-off-by: joshvanl <me@joshvanl.dev>

* Linting

Signed-off-by: joshvanl <me@joshvanl.dev>

* Add sleep to wait for windows fsnotify to become ready

Signed-off-by: joshvanl <me@joshvanl.dev>

* Increase time for event to be received to 1 second

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
2023-11-15 16:36:20 -08:00
Alessandro (Ale) Segala 0e1fd37fc4
Migrate metadata decoder from components-contrib to kit (#74)
* Migrate metadata decoder from components-contrib to kit

Required creating the `utils` package for utils.IsTruthy too (ported from runtime)

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Lint

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-10-31 14:15:30 -07:00
Alessandro (Ale) Segala 2e939bc273
Move dapr/utils/streams to kit (#68)
* Move dapr/utils/streams to kit

No code changes

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* 💄

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Lint

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-10-31 13:12:15 -07:00
Alessandro (Ale) Segala 76c6281dda
Move `pkg/signals` from dapr/dapr to kit (#70)
No code changes

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-10-30 11:56:03 -07:00
Alessandro (Ale) Segala 49532df126
Move dapr/concurrency to kit (#72)
* Move dapr/concurrency to kit

Does not include any code change

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Fixed copyright year

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Improved memory usage in error collection

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-10-30 11:55:52 -07:00
Alessandro (Ale) Segala c0ebd07f3a
Migrate dapr/utils/byteslicepool to kit (#73)
No code changes (aside from those needed to appease the linter)

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-10-30 11:55:45 -07:00
Alessandro (Ale) Segala 2d30434d91
Update linter to 1.55.1 and fix linter errors (#71)
* Update linter to 1.55.1 and fix linter errors

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Also disable tagalign linter

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-10-30 11:55:29 -07:00
Alessandro (Ale) Segala a0df11f512
Tiny: use `Load` instead of `CompareAndSwap` for detecting recoveries (#69)
Should be _slightly_ faster

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-10-30 16:18:57 +00:00
Josh van Leeuwen 4f434ebc3f
Adds events/ratelimiting/coalescing (#64)
* Adds events/ratelimiting/coalecing

events/ratelimiting is a new utility package to provides helpers which
can be used to rate limit events.

Coalecing is a new helper that will exponentially rate limit events. It
will coalesce events into a single event if they occur within the same
rate limiting window. Coalesce also has the option to forcibly fire an
event when the number of events reaches a certain threshold. Added to
prevent events from never being fired in a high throughput scenario.

Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: Josh van Leeuwen <me@joshvanl.dev>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2023-10-25 13:15:16 -07:00
Josh van Leeuwen 55bfe3b570
Adds `--build-tags=unit` to golang lint config file (#67)
* Adds `--build-tags=unit` to golang lint GitHub Action

Signed-off-by: joshvanl <me@joshvanl.dev>

* Move golang-list workflow build-tags CLI args to .golangci.yml

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
2023-10-24 08:07:56 -07:00
Josh van Leeuwen 099b0404d1
Use mocked clock in cron tests, rather than wall clock (#66)
PR updates the cron tests to use a mocked clock instead of the wall
in order to speed up the tests from ~40s to ~1.5s. This also has the
benefit of controlling time so that tests are more deterministic.

Signed-off-by: joshvanl <me@joshvanl.dev>
2023-10-23 09:53:28 -07:00
Josh van Leeuwen 549b95799f
Fixing running tests on aarch64 arm machines (#65)
* Fixing running tests on aarch64 arm machines

Signed-off-by: joshvanl <me@joshvanl.dev>

* Use different Makefile target for doing go test with race enabled

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
2023-10-22 06:51:12 -07:00
Roberto Rojas a043330f5d
Dapr Error Handling/Codes - Add Internal Shared Functionality (#57)
Signed-off-by: robertojrojas <robertojrojas@gmail.com>
Signed-off-by: Roberto Rojas <robertojrojas@gmail.com>
Signed-off-by: Josh van Leeuwen <me@joshvanl.dev>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Josh van Leeuwen <me@joshvanl.dev>
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2023-09-14 12:04:04 -07:00
Alessandro (Ale) Segala 50fac882cf
events: make "WithClock" methods allowed without "unit" build tag (#62)
There are use cases where having those methods available even outside of a unit test is helpful, such as when the objects are instantiated with a clock that could be mocked in the unit test for the parent method.

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-09-13 14:59:34 -07:00
Josh van Leeuwen f08dc3ff16
Use correct package name in queue/processor_unit.go (#61)
Signed-off-by: joshvanl <me@joshvanl.dev>
2023-09-07 09:50:49 -07:00
Bernd Verst cf6d06a761
Upgrade dependencies (#60)
Signed-off-by: Bernd Verst <github@bernd.dev>
2023-09-05 08:11:01 -07:00
Josh van Leeuwen c007625dc6
Always wait in close, Speed up eventqueue tests & don't pass clock (#59)
* Don't pass clock to processor, and speed up tests

Signed-off-by: joshvanl <me@joshvanl.dev>

* Review comments

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
2023-08-28 17:31:14 -07:00
Josh van Leeuwen 569cc87ddb
Adds batcher utility (#58)
* Adds batcher utility

Signed-off-by: joshvanl <me@joshvanl.dev>

* Add `WithClock` for testing

Signed-off-by: joshvanl <me@joshvanl.dev>

* Renamees eventqueue to queue, and move queue and batcher under events

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
2023-08-14 13:04:38 -07:00
Alessandro (Ale) Segala b6b141aa3e
Added eventqueue package (#54)
* Added eventqueue package

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Changed per review feedback

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Renamed lock

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-08-07 15:50:40 -07:00
Alessandro (Ale) Segala bc1c1eee0a
Remove deprecated package github.com/benbjohnson/clock (#55)
* Remove deprecated package github.com/benbjohnson/clock

Replaced with k8s.io/utils/clock

Fixes #50

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Apply suggestions from code review

Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2023-08-05 20:42:49 -07:00
Alessandro (Ale) Segala 804821bb8f
Update jwx and other deps (#53)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-06-15 15:52:44 -07:00
Alessandro (Ale) Segala fdebb00fc2
Update JWX library which lazily-inits the httprc fetcher (#52)
This makes it so there are no 3 additional goroutines (even if idle) created when the library is imported.

See: lestrrat-go/jwx#929

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-06-06 10:58:59 -07:00
Alessandro (Ale) Segala f49c7e5230
ParseKey: ignore trailing newlines when parsing base64-encoded keys (#51)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-06-05 11:22:46 -07:00
Alessandro (Ale) Segala 9514168def
Update deps (#49) 2023-05-25 09:11:38 -07:00
joshvanl 56f99b79fb Adds `context` package with `Pool`
Signed-off-by: joshvanl <me@joshvanl.dev>
2023-05-24 14:02:18 -07:00
Alessandro (Ale) Segala 15a7040dec
Dapr crypto scheme v1 (high level methods) (#42)
* Implement Dapr crypto scheme v1

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Added spec document

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Apply suggestions from code review

Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>

* Specify that 256-bit keys are required for AES-KW

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Add AES-CBC for key wrapping

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Add option DecryptionKeyName + some tweaks

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Uppercase ciphers

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Export BufPool

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Update crypto/schemes/enc/v1/README.md

Co-authored-by: Tiago Alves Macambira <tmacam@burocrata.org>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>

* Make carryover not a pointer

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Moved package to root folder

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Removed dependency on jwk library in schemes

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Updated per review feedback

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Addressed review feedback

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Tiago Alves Macambira <tmacam@burocrata.org>
2023-04-18 12:36:28 -07:00
Alessandro (Ale) Segala c93a9df941
JWKS Cache: add WaitForCacheReady method (#47)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-04-18 10:01:51 -07:00
Alessandro (Ale) Segala b60341fe3e
Add jwkscache package (#46)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-04-17 22:50:30 -07:00
Alessandro (Ale) Segala 24e430f399
crypto: ParseKey should not panic if key is empty (#45)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-04-10 19:25:16 -07:00
Alessandro (Ale) Segala e1fba87ca2
Use ASN.1 serialization for ECDSA signatures (#44)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-04-05 23:00:32 +05:30
Alessandro (Ale) Segala 30d122f67b
Crypto: Add methods returning the list of supported algorithms (#43)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-04-01 14:52:30 +05:30
Alessandro (Ale) Segala eadb01f64f
Updates crypto libraries, incl. security fixes (#41)
Updates github.com/lestrrat-go/jwx/v2 and golang.org/x/crypto, which also includes security fixes

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-03-26 16:01:36 +05:30
Alessandro (Ale) Segala efcc1af907
Add AES-CBC-HMAC AEAD cipher to Dapr crypto (#40)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-03-20 17:36:08 -07:00
Alessandro (Ale) Segala b5bafe889a
Refactored ParseISO8601Duration for 18x perf improvement (#39)
* WIP: Refactored ParseISO8601Duration

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Completed work

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* 💄

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-03-07 11:25:05 -08:00
Alessandro (Ale) Segala 39814af4c7
Add Dapr crypto library to dapr/kit (#38)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-03-07 11:22:05 -08:00
Bernd Verst fcb09958bf
Update CODEOWNERS (#37)
Update CODEOWNERS in line with https://github.com/dapr/community/issues/248

Signed-off-by: Bernd Verst <github@bernd.dev>

Signed-off-by: Bernd Verst <github@bernd.dev>
2023-01-05 12:25:59 -08:00
Alessandro (Ale) Segala 73be7928f6
Updates: (#36)
1. Removed `github.com/pkg/errors` and replaced with the standard library (linter now rejects the old package)
2. Cron test: fixed race conditions and linting
3. Renamed `logger/default.go` to `logger/nop_logger.go` to match the name of the struct inside

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-01-05 12:12:21 -08:00