Commit Graph

93 Commits

Author SHA1 Message Date
github-actions[bot] c5aa7d8327
Bump to 3.0.1-SNAPSHOT (#617)
Signed-off-by: GitHub <noreply@github.com>
Co-authored-by: pierDipi <pierDipi@users.noreply.github.com>
2024-03-26 10:37:36 +01:00
github-actions[bot] c018f951b1
Bump to 3.0.0 (#616)
Signed-off-by: GitHub <noreply@github.com>
Co-authored-by: pierDipi <pierDipi@users.noreply.github.com>
2024-03-26 09:58:25 +01:00
touchkey 111fb55cfd
feat: Customizing Cloudevents validation (#594)
Add SPI for custom CloudEvent validation.

Signed-off-by: vbhat6 <vinayas_bhat@intuit.com>
2024-02-15 07:48:55 +01:00
Alex Collins 4ef304115a
[working-draft] Support Avro Compact Format (#578)
Add support for working-draft spec Avro compact format: 777d0c0398

Signed-off-by: Alex Collins <alex_collins@intuit.com>
2023-07-20 18:02:59 +02:00
github-actions[bot] 5ef1088a19
Bump to 3.0.0-SNAPSHOT (#571)
Signed-off-by: GitHub <noreply@github.com>
Co-authored-by: pierDipi <pierDipi@users.noreply.github.com>
2023-05-23 10:55:49 +02:00
skepticoitusInteruptus 4ebeab0e0f
Refactor to Facilitate Decoupling from Concrete Implementations of EventFormat (#539)
- Introduce ContentType enum
- Resolve formats by using the ContentType enum

Signed-off-by: Randi Sheaffer-Klass <97033958+skepticoitusInteruptus@users.noreply.github.com>
2023-04-21 10:41:10 +02:00
Pierangelo Di Pilato f71303b7b7
Switch default branch to main (#506)
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2023-01-12 19:03:51 +01:00
Jem Day 433ec5b274
Initial Implementation of XML Format (#448)
Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
Signed-off-by: Jem Day <Jem.Day@cliffhanger.com>
2023-01-10 09:48:36 +01:00
Doug Davis 40fe91a5e0
Use UTF-8 when using getBytes (#491)
Closes #488

Signed-off-by: Doug Davis <dug@microsoft.com>
2023-01-05 18:01:14 +01:00
Gerard Klijs adde53c817
Correct URL to naming-conventions (#477)
Signed-off-by: Gerard Klijs <gerard.klijs@axoniq.io>
2022-09-14 15:46:09 +02:00
github-actions[bot] b9eaa2fcaa
Bump to 2.5.0-SNAPSHOT (#474)
Signed-off-by: GitHub <noreply@github.com>
Co-authored-by: pierDipi <pierdipi@redhat.com>
2022-09-06 15:52:34 +02:00
Pierangelo Di Pilato 45ec85f8c1
Optimize `isCloudEventsHeader` check (#445)
Instead of using:
```java
key.substring(0, CE_PREFIX.length()).toLowerCase().startsWith(CE_PREFIX);
```
we can just use:
```java
key.regionMatches(true /* ignoreCase */, 0, CE_PREFIX, 0, CE_PREFIX.length());
```

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
2022-07-13 10:18:17 +02:00
github-actions[bot] 4784f03e8c
Bump to 2.4.0-SNAPSHOT (#439)
Signed-off-by: GitHub <noreply@github.com>

Co-authored-by: pierDipi <pierdipi@redhat.com>
2021-12-21 12:18:07 +01:00
Pierangelo Di Pilato ace6859ae0
Bump version to 2.3.0 (#437)
Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
2021-12-21 12:06:57 +01:00
Dmitrii Bocharov 32adfe9123
Fix NPE in CloudEventDeserializer when deserializing header with null value (#415)
Signed-off-by: Dmitrii Bocharov <dmitrii.bocharov@embedit.cz>
2021-11-03 08:28:54 +01:00
github-actions[bot] 722f5205b3
Bump to 2.3.0-SNAPSHOT (#400)
Signed-off-by: GitHub <noreply@github.com>

Co-authored-by: slinkydeveloper <slinkydeveloper@users.noreply.github.com>
2021-06-17 12:18:55 +02:00
github-actions[bot] 8ad857d8c7
Bump to 2.2.0 (#399)
Signed-off-by: GitHub <noreply@github.com>

Co-authored-by: slinkydeveloper <slinkydeveloper@users.noreply.github.com>
2021-06-17 12:05:04 +02:00
github-actions[bot] c8f10e9215
Bump to 2.2.0-SNAPSHOT (#378)
Signed-off-by: GitHub <noreply@github.com>

Co-authored-by: slinkydeveloper <slinkydeveloper@users.noreply.github.com>
2021-04-28 15:50:41 +02:00
github-actions[bot] ba9ccad5d2
Bump to 2.1.0 (#377)
Signed-off-by: GitHub <noreply@github.com>

Co-authored-by: slinkydeveloper <slinkydeveloper@users.noreply.github.com>
2021-04-28 15:24:41 +02:00
Francesco Guardiani 78355bb225
Fix #326 (#376)
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2021-04-28 15:15:45 +02:00
Johan Haleby 30fd6769eb
fix: Adding withoutData, withoutDataContentType and withoutDataSchema to CloudEventBuilder (#374)
Signed-off-by: Johan Haleby <johan.haleby@gmail.com>
2021-04-23 13:59:39 +02:00
Erik Paulson 928ebcfd6f
formats: Add support for protobuf format (#348)
* formats: Add support for protobuf format

Adds support for the Protocol Buffer CloudEvent format defined at
https://github.com/cloudevents/spec/blob/v1.0.1/protobuf-format.md.

Compiles the Proto3 file taken from the spec repo into generated Java
protobuf classes. These classes are used to convert the SDK
representation of a CloudEvent to and from the protobuf format.

Signed-off-by: Erik Paulson <epaulson@apexclearing.com>

* Address feedback in PR #348

- Adds service file for event format autoloading
- Addresses some field access issues
- Treats unset fields as omitted
- Updates and adds documentation

Signed-off-by: Erik Paulson <epaulson@apexclearing.com>

* Add missing attribute writer methods for CloudEventBuilders

Without these methods, binary attributes are interpreted as
Strings instead of byte[].

Signed-off-by: Erik Paulson <epaulson@apexclearing.com>

* Added test data files.

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* - Now executes tests related to wire-format files.
- Supports V03 dialect

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* - Added new ProtoCloudEventData construct to support proto message based data.
- Added some more test files.

- When the PR related to binary context attributes is merged we can extend the
test use-cases appropriately.

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* - Merged changes related to binary context attributes.
- Modified proto format to process binary context attributes
- Added CloudEventData varient to hold proto messages (requires tests)
- Will add further tests once the failing test is addressed

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* Added test for protobuf data

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* Indicate that v0.3 events are supported by Protobuf Format

Even though the protobuf spec came out for v1, the attributes are
fairly easily mapped back to v0.3.

Signed-off-by: Erik Paulson <epaulson@apexclearing.com>

* Add missing comments; fix formatting; minor refactoring

Signed-off-by: Erik Paulson <epaulson@apexclearing.com>

* Create a full Protobuf CloudEventWriter

Converts the ProtoContextWriter class to a ProtoCloudEventWriter class
and modifies the format code to use it instead of manually writing
data to the output.

Signed-off-by: Erik Paulson <epaulson@apexclearing.com>

* - Addressed Review Comments.
- Introduced a default ProtoDataWrapper
- Tests updated.

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* Address Review Comments

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* Test cleanup and timezone testing

This does some tweaking to tests by moving to using assertj and fixing
whitespace. It also adds a new test to ensure that timezones are handled
correctly.

Signed-off-by: Erik Paulson <epaulson@apexclearing.com>

* Formatting cleanup

- Remove unecessary whitespace
- Fix Javadocs
- Delete unused code

Signed-off-by: Erik Paulson <epaulson@apexclearing.com>

Co-authored-by: Day, Jeremy(jday) <jday@paypal.com>
2021-04-19 09:24:26 +02:00
Pierangelo Di Pilato a4613c00d2
Avoid allocating an array on extension validation (#367)
Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
2021-04-06 10:14:08 +02:00
Pierangelo Di Pilato 69f0e20549
CloudEvents attribute names SHOULD NOT exceed 20 chars (#366)
As per spec [1], attribute names SHOULD NOT and not MUST NOT
exceed 20 characters in length.

[1] https://github.com/cloudevents/spec/blob/master/spec.md#attribute-naming-conventionthis

Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
2021-04-06 10:00:55 +02:00
Jem Day e2b13109e4
Throw exceptions when atempting to handling unsupport CloudEvent formats. (#362)
- Modfy logic that selects between structured and binary modes during reception.
- Introduced new test scenarios to veify behavior.

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
2021-03-26 09:55:23 +01:00
Jem Day 5e3bfc890f
Specification Compliant handling of numeric context attributes (#358)
* - Added tests case to verify expected handling of numeric context attributes
- Updated serializer.

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* - Added @deprecated marker for CloudEventContextWriter.set(name, Number)
- Added use of new method for JSON serializer.

Cleanup of deprecated implementations can occur independantly.

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* Addressed Review Comments

- Now throws exception when non specification compliant numeric
  attribute values are received during deserialization.

- Added test cases to verify deserialization exceptions.

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* Address Review Comments

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* Address Review Comment

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
2021-03-24 16:58:33 +01:00
Jem Day 13f8b56618
Introduced support for Binary attribute types. (#353)
* Introduced support for Binary attribute types.

Added test data example
Added unit-test for JSON Format

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* documentation tweak

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* - Addressed review comment.
- Removed the withContextAttribute(string, Integer).
   - This should be a seperate PR, was mixed-in by accident.

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>

* Address review comments

Signed-off-by: Day, Jeremy(jday) <jday@paypal.com>
2021-03-10 11:29:38 +01:00
Dave Syer f05418cba9
Allow user to enumerate supported content types (#350)
Signed-off-by: Dave Syer <dsyer@vmware.com>
2021-03-01 11:02:54 +01:00
github-actions[bot] 70782da2c2
Bump to 2.1.0-SNAPSHOT (#346)
Signed-off-by: GitHub <noreply@github.com>

Co-authored-by: slinkydeveloper <slinkydeveloper@users.noreply.github.com>
2021-02-15 09:19:58 +01:00
github-actions[bot] 48fc69e058
Bump to 2.0.0 (#343)
Signed-off-by: GitHub <noreply@github.com>

Co-authored-by: slinkydeveloper <slinkydeveloper@users.noreply.github.com>
2021-02-15 09:09:09 +01:00
Francesco Guardiani e523bfbfbf
Rename extension (#339)
* Fixed broken links

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Renamed Extension to CloudEventExtension

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

Co-authored-by: slinkydeveloper <slinkydeveloper@users.noreply.github.com>
2021-02-02 08:32:43 +01:00
github-actions[bot] 611f2292a7
Bump to 2.0.0-SNAPSHOT (#329)
Signed-off-by: GitHub <noreply@github.com>

Co-authored-by: slinkydeveloper <slinkydeveloper@users.noreply.github.com>
2020-12-11 11:15:02 +01:00
github-actions[bot] 296230719b
Bump to 2.0.0.RC2 (#327)
Signed-off-by: GitHub <noreply@github.com>

Co-authored-by: slinkydeveloper <slinkydeveloper@users.noreply.github.com>
2020-12-11 11:04:09 +01:00
Francesco Guardiani 3a22557b83
Website docs (#324)
* Halfway through it

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* That should be it

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Prettier run

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Removed code sample

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Suggestions + fixed up the mess made by prettier

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Suggestion

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2020-12-11 10:38:04 +01:00
Francesco Guardiani f5d9b47c1c
Javadocs api and core (#313)
* Javadocs!!!

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Missing module name?

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Excluding javadocs

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* clean install only release artifacts, but verify them all!

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Reverted the crazy idea to use the release profile

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Suggestions

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Suggestion

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Nit

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Nit

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Nit

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2020-12-09 18:31:56 +01:00
Francesco Guardiani b89f45265b
Simplify the Reader/Writer implementations, reducing the knowledge of spec details (#309)
* Messing up stuff

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Collapse CloudEventAttributesWriter and CloudEventAttributesWriter into CloudEventContextWriter

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Rebase fix

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2020-12-01 17:27:50 +01:00
github-actions[bot] bcc1434a39
Bump to 2.0.0-SNAPSHOT (#310)
Signed-off-by: GitHub <noreply@github.com>

Co-authored-by: slinkydeveloper <slinkydeveloper@users.noreply.github.com>
2020-11-26 16:48:45 +01:00
github-actions[bot] c1c55ac1d6
Bump to 2.0.0.RC1 (#305)
Signed-off-by: GitHub <noreply@github.com>

Co-authored-by: slinkydeveloper <slinkydeveloper@users.noreply.github.com>
2020-11-26 16:34:41 +01:00
Francesco Guardiani 2524cdf324
Fix NPE on null body with structured message (#306)
* Fix NPE on null body with structured message

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Improved test robustness

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2020-11-26 12:49:57 +01:00
Sreenath Madasu 5a926820b4
Remove UnknownEncodingMessageReader and replace with exceptions #262 (#277)
* Javadoc'ed + Cleanup of the api module (#267)

* Javadoc'ed more and more the api module
Cleanup the CloudEventRWException
More tests on the API module

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Use parseTime

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Better docs on the Extensions

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Sreenath Madasu <MADASUSX@legal.regn.net>

* Remove UnknownEncodingMessageReader and replace with exceptions #262

Signed-off-by: Sreenath Madasu <Sreenath.Madasu@gmail.com>

* Remove UnknownEncodingMessageReader and replace with exceptions -- Added Unit tests #262

Signed-off-by: Sreenath Madasu <Sreenath.Madasu@gmail.com>

* Remove UnknownEncodingMessageReader and replace with exceptions -- Fixed compile error #262

Signed-off-by: Sreenath Madasu <Sreenath.Madasu@gmail.com>

* Remove UnknownEncodingMessageReader and replace with exceptions -- changed exception name and details #262

    Signed-off-by: Sreenath Madasu <Sreenath.Madasu@gmail.com>

Signed-off-by: Sreenath Madasu <MADASUSX@legal.regn.net>

* Fixed

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

Co-authored-by: Francesco Guardiani <francescoguard@gmail.com>
Co-authored-by: Sreenath Madasu <MADASUSX@legal.regn.net>
2020-11-26 11:23:24 +01:00
Dave Syer 377850cb61
Simplify BaseCloudEventBuilder constructor (#300)
Signed-off-by: Dave Syer <dsyer@vmware.com>
2020-11-24 11:40:15 +01:00
Francesco Guardiani 5037a69a80
Add method `BytesCloudEventData#wrap` (#291)
* Add the method `BytesCloudEventData#wrap` to be consistent with #289

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Removed all usages of constructor

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2020-11-24 09:57:16 +01:00
Francesco Guardiani ceb5a2eeb2
Pom cleanup (#290)
* Fix poms warnings
Bumped javadoc plugin to latest version

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Dumped back the javadoc version

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2020-11-24 09:56:42 +01:00
Alfusainey Jallow 2d68c4843f
Use constants added in #280 (#282)
Signed-off-by: Alfusainey Jallow <alf.jallow@gmail.com>
2020-11-24 08:43:12 +01:00
Dave Syer 7f65c92dec
Introduce CloudEventContext (#296)
* Introduce CloudEventContext

Signed-off-by: Dave Syer <dsyer@vmware.com>

* Extract some code into a base class

Signed-off-by: Dave Syer <dsyer@vmware.com>

* Ensure extensions get copied in constructor

Signed-off-by: Dave Syer <dsyer@vmware.com>

* Introduce a CloudEventContextReaderAdapter

Signed-off-by: Dave Syer <dsyer@vmware.com>

* Use inheritance instead of composition

Signed-off-by: Dave Syer <dsyer@vmware.com>
2020-11-23 21:05:26 +01:00
Francesco Guardiani c9b3fa4b65
Move PojoCloudEventData in core (#289)
* Add a static method to wrap a pojo in PojoCloudEventData

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* WIP

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Cleanup

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Reverted BytesCloudEventData and moved to a separate PR

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2020-11-23 15:59:33 +01:00
Francesco Guardiani 394347db07
CloudEventAttributesWriter and CloudEventExtensionsWriter accepts only not nil attributes/extensions (#287)
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2020-11-23 11:28:56 +01:00
Francesco Guardiani 6c78428513
Removing ContextAttributes enums (#280)
* Removed ContextAttributes.java in CloudEventV03

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Rebase changes

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Removed ContextAttributes.java in CloudEventV1

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Public constants + javadoc

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2020-11-20 11:27:36 +01:00
Sung Kyu Park bf60a25098
Update dataref extension value to string to be supported by BaseCloudEvent.readExtensions (#292)
Signed-off-by: kpark <kpark@guidewire.com>

Co-authored-by: kpark <kpark@guidewire.com>
2020-11-20 08:30:23 +01:00
Francesco Guardiani baf3b56d6d
Introduce CloudEventDataMapper.identity() (#286)
* CloudEventDataMapper cannot be null
Cleanup of all mapper != null and replaced with CloudEventDataMapper.NOOP
Fixed all the missing wildcards

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* I forgot a bunch of them

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* CloudEventDataMapper.NOOP to CloudEventDataMapper.identity

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Now it should be fine

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2020-11-19 18:24:14 +01:00