FEAT: Add the 51Did (FodId) reader module (pipeline.did)#101
Merged
Conversation
18 tasks
Contributor
|
This Java module copies the OWID source files into itself when it builds rather than just depending on it. 51Degrees code, licensed EUPL-1.2 For the Apache-2.0 licence, every copy must come with a copy of the Apache licence text and a credit saying what it is and where it came from. Right now the jar contains the OWID code but not the licence text or credit, so anyone who downloads the jar from maven is receiving Apache-licensed code without the paperwork that Apache-2.0 requires to travel with it. |
Jamesr51d
reviewed
Jul 2, 2026
…undle the OWID Apache-2.0 licence + NOTICE.
Jamesr51d
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
pipeline.did, a strongly typed Java reader for the 51Did (51DegreesIdentifier) value returned by the 51Degrees Cloud service. Mirrors the .NET
FiftyOne.Didpackage. Also adds an offline developer example.What it does
FodIdparses a 51Did from its base64 OWID form and exposes the payloadfields —
getFlags(),getLicenseId()(unsigned little-endian aslong),getHash()(the stable value, defensive copy), andgetType()— plus theOWID-level fields via the wrapped envelope.
Typemodel (flag bits 6-7: Probabilistic / Random /HashedEmail / Reserved) with per-type value length (16 or 32 bytes).
Owidisfinal). Construction doesnot verify the signature;
verify(publicPem)is an explicit, separatecall.
OWID dependency
Builds on owid-java (
com.swancommunity.owid), consumed from the51Degrees/owid-javafork as a git submodule (owid-java/) whose source iscompiled into the module (mirroring how
pipeline-dotnetcompilesowid-dotnetin). The submodule is pinned to the fork's
feature/java8-baselinebranch,which lowers the OWID build to Java 8 to match
pipeline-java(owid-java targets Java 21 upstream).
Build & enforcement
pipeline.didregistered in the aggregatorpom.xml; Java 8;EUPL-1.2 headers.
EndpointsOWID class is excluded from compilation (not neededfor offline parse + verify).
java18signature so the build fails onany Java 9+ API — this is what guarantees the Java 8 floor (the parent's
-source/-target 1.8alone does not catch newer JDK APIs).Tests & example
FodIdTests(JUnit 4): the full ported .NET suite including theType-modelcases plus the runbook gap tests — 31 tests, all passing. Verify cases run
offline (owid-java has offline verify).
pipeline.developer-examples.fodid— a self-contained offline example(build, parse, compare two 51Dids) with an
ExampleTestssmoke test.mvn -pl pipeline.did testgreen, and the full reactormvn -DskipTests installbuilds all modules including the two new ones.Notes for reviewers
FodIduses static factories (fromBase64/fromByteArray/fromOwid)because owid-java's parse throws the checked
OwidException.assertArrayEquals),not identity, because owid-java getters return clones.