Java implementation of the OpenFeature SDK
Go to file
Pramesh 113b5e5f2e
fix(deps): Spot bug scope change (#173)
* chore: add integration tests (#77)

* chore: add integration tests

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* improve POM spacing

Signed-off-by: Todd Baert <toddbaert@gmail.com>

Signed-off-by: Todd Baert <toddbaert@gmail.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(main): release dev.openfeature.javasdk 0.2.2 (#76)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* feat!: errorCode as enum, reason as string (#80)

* feat!: errorCode as enum, reason as string

- makes errorCode an enum
- makes reason a string
- adds errorMessage to resolution/evaluation details

Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: add CODEOWNERS (#85)

Create CODEOWNERS

refs https://github.com/open-feature/java-sdk/issues/83

Signed-off-by: Justin Abrahms <jabrahms@ebay.com>

Signed-off-by: Justin Abrahms <jabrahms@ebay.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: Configure Renovate (#86)

chore(deps): add renovate.json

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency com.github.spotbugs:spotbugs to v4.7.2 (#87)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency com.github.spotbugs:spotbugs-maven-plugin to v4.7.2.0 (#88)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.4.1 (#90)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency org.sonatype.plugins:nexus-staging-maven-plugin to v1.6.13 (#91)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* fix(deps): update junit5 monorepo (#92)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency org.apache.maven.plugins:maven-pmd-plugin to v3.19.0 (#97)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* fix(deps): update dependency io.cucumber:cucumber-bom to v7.8.0 (#100)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency org.mockito:mockito-core to v4.8.0 (#99)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update codecov/codecov-action action to v3 (#102)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency org.apache.maven.plugins:maven-gpg-plugin to v1.6 (#96)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Justin Abrahms <jabrahms@ebay.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency org.apache.maven.plugins:maven-source-plugin to v3 (#105)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.10.1 (#95)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency org.apache.maven.plugins:maven-gpg-plugin to v3 (#104)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency org.apache.maven.plugins:maven-checkstyle-plugin to v3.2.0 (#94)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update actions/cache action to v3 (#101)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency com.puppycrawl.tools:checkstyle to v8.45.1 (#93)

* chore(deps): update dependency com.puppycrawl.tools:checkstyle to v8.45.1

* scope property went away in the latest version

https://github.com/jshiell/checkstyle-idea/issues/525#issuecomment-832084505

Signed-off-by: Justin Abrahms <jabrahms@ebay.com>

* scope wasn't deleted on the other one

Signed-off-by: Justin Abrahms <jabrahms@ebay.com>

Signed-off-by: Justin Abrahms <jabrahms@ebay.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Justin Abrahms <jabrahms@ebay.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* refactor!: Change the package name. Everyone knows it's java (or it doesn't matter) (#111)

* Change the package name. Everyone knows it's java (or it doesn't matter)

Fixes #82

Signed-off-by: Justin Abrahms <justin@abrah.ms>

* Missed 2 strings

Signed-off-by: Justin Abrahms <justin@abrah.ms>

* remove broken flagd import until changes absorbed

Signed-off-by: Todd Baert <toddbaert@gmail.com>

Signed-off-by: Justin Abrahms <justin@abrah.ms>
Signed-off-by: Todd Baert <toddbaert@gmail.com>
Co-authored-by: Todd Baert <toddbaert@gmail.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: Write perms should be as tightly scoped as possible. (#107)

* Add a dependabot file to keep deps up to date

Signed-off-by: Justin Abrahms <justin@abrah.ms>

* Move write permissions to the specific job, rather than globally

Signed-off-by: Justin Abrahms <justin@abrah.ms>

* Run code scanning (slow auto-build) weekly

Signed-off-by: Justin Abrahms <justin@abrah.ms>

Signed-off-by: Justin Abrahms <justin@abrah.ms>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: fix dependabot pr titles (#118)

Signed-off-by: Todd Baert <toddbaert@gmail.com>

Signed-off-by: Todd Baert <toddbaert@gmail.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: Bump cucumber-bom from 7.8.0 to 7.8.1 (#115)

Bump cucumber-bom from 7.8.0 to 7.8.1

Bumps [cucumber-bom](https://github.com/cucumber/cucumber-jvm) from 7.8.0 to 7.8.1.
- [Release notes](https://github.com/cucumber/cucumber-jvm/releases)
- [Changelog](https://github.com/cucumber/cucumber-jvm/blob/main/CHANGELOG.md)
- [Commits](https://github.com/cucumber/cucumber-jvm/compare/v7.8.0...v7.8.1)

---
updated-dependencies:
- dependency-name: io.cucumber:cucumber-bom
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: add SAST scanning (#108)

* add SAST scanning

Refs #84

Signed-off-by: Justin Abrahms <justin@abrah.ms>

* Java scanning only

Signed-off-by: Justin Abrahms <justin@abrah.ms>

* Try codeql on the normal build to see how much longer it is.

Signed-off-by: Justin Abrahms <justin@abrah.ms>

Signed-off-by: Justin Abrahms <justin@abrah.ms>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* feat!: use evaluation context interface (#112)

* POC - use evaluation context interface

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* make .merge non-static

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* improve naming

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* add @override

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* Update src/main/java/dev/openfeature/sdk/EvaluationContext.java

Co-authored-by: Justin Abrahms <jabrahms@ebay.com>
Signed-off-by: Todd Baert <toddbaert@gmail.com>

* Update src/main/java/dev/openfeature/sdk/MutableContext.java

Co-authored-by: Justin Abrahms <jabrahms@ebay.com>
Signed-off-by: Todd Baert <toddbaert@gmail.com>

* address PR feedback

Signed-off-by: Todd Baert <toddbaert@gmail.com>

Signed-off-by: Todd Baert <toddbaert@gmail.com>
Co-authored-by: Justin Abrahms <jabrahms@ebay.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* feat: Support for generating CycloneDX sboms (#119)

Signed-off-by: Justin Abrahms <justin@abrah.ms>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: [StepSecurity] ci: Harden GitHub Actions (#120)

* [StepSecurity] ci: Harden GitHub Actions in release.yml

* [StepSecurity] ci: Harden GitHub Actions in static-code-scanning.yaml

* [StepSecurity] ci: Harden GitHub Actions in lint-pr.yml

* [StepSecurity] ci: Harden GitHub Actions in merge.yml

* [StepSecurity] ci: Harden GitHub Actions in pullrequest.yml

Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: I don't think we use that permission? (#123)

I don't think we use that permission?

Signed-off-by: Justin Abrahms <jabrahms@ebay.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: Document where to find our SBOMs (#124)

Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update actions/cache digest to a3f5edc (#121)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update actions/setup-java digest to e150063 (#125)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: Remove more perms (#130)

Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency org.cyclonedx:cyclonedx-maven-plugin to v2.7.1 (#128)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update github/codeql-action digest to 3d39294 (#127)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update codecov/codecov-action digest to e0fbd59 (#126)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: Bump actions/checkout from 3.0.2 to 3.1.0 (#139)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.0.2 to 3.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](2541b1294d...93ea575cb5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: Bump actions/setup-java from e150063ee446b60ce2e35b040e81846da9001576 to a82e6d00200608b0b4c131bc9a89f7349786bd33 (#140)

chore: Bump actions/setup-java

Bumps [actions/setup-java](https://github.com/actions/setup-java) from e150063ee446b60ce2e35b040e81846da9001576 to a82e6d00200608b0b4c131bc9a89f7349786bd33.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](e150063ee4...a82e6d0020)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: bump spotbugs-maven-plugin from 4.7.2.0 to 4.7.2.1 (#136)

Bumps [spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.7.2.0 to 4.7.2.1.
- [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases)
- [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.7.2.0...spotbugs-maven-plugin-4.7.2.1)

---
updated-dependencies:
- dependency-name: com.github.spotbugs:spotbugs-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Abrahms <jabrahms@ebay.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: exclude component in git tag (#143)

Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>

Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update dependency org.cyclonedx:cyclonedx-maven-plugin to v2.7.2 (#141)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* feat!: add rw locks to client/api, hook accessor name (#131)

* fix: add read/write locks to client/api

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* dont lock entire evaluation

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* add tests

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* fixup comment

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* fixup pom comment

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* increase lock granularity, imporove tests

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* fix spotbugs

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* remove commented test

Signed-off-by: Todd Baert <toddbaert@gmail.com>

Signed-off-by: Todd Baert <toddbaert@gmail.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update actions/setup-java digest to 3617c43 (#132)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update amannn/action-semantic-pull-request digest to b314c1b (#135)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Justin Abrahms <jabrahms@ebay.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: Remove dependabot. I like renovate better (#142)

Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update amannn/action-semantic-pull-request digest to 7c194c2 (#144)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update github/codeql-action digest to 44edb7c (#133)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update actions/checkout digest to 8230315 (#122)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(main): release 0.3.0 (#114)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Justin Abrahms <jabrahms@ebay.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: re-enable integration tests (#146)

Update test harness and re-enable integration test profile

Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update actions/cache digest to 9b0c1fc (#145)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Justin Abrahms <jabrahms@ebay.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* fix: merge eval context (#149)

fix merge eval context

Signed-off-by: Robert Grassian <robert.grassian@split.io>

Signed-off-by: Robert Grassian <robert.grassian@split.io>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(main): release 0.3.1 (#150)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update github/codeql-action digest to 297ec80 (#147)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: update test/spec association numbers, badge (#156)

* chore: update test/spec association numbers

Signed-off-by: Todd Baert <toddbaert@gmail.com>

* chore: update spec tag

Signed-off-by: Todd Baert <toddbaert@gmail.com>

Signed-off-by: Todd Baert <toddbaert@gmail.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update actions/cache digest to 2b04a41 (#158)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(security): [Snyk] Security upgrade com.github.spotbugs:spotbugs from 4.7.2 to 4.7.3 (#157)

fix: pom.xml to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JAVA-ORGAPACHECOMMONS-3043138

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: Add docs link (#165)

Signed-off-by: Todd Baert <toddbaert@gmail.com>

Signed-off-by: Todd Baert <toddbaert@gmail.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore: Mark project as active. (#167)

Mark project as active.

Signed-off-by: Justin Abrahms <jabrahms@ebay.com>

Signed-off-by: Justin Abrahms <jabrahms@ebay.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(main): release 1.0.0 (#168)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* chore(deps): update actions/cache digest to 8bec1e4 (#159)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

* changes spotbug scope to provided.

Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>

Signed-off-by: Todd Baert <toddbaert@gmail.com>
Signed-off-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>
Signed-off-by: Justin Abrahms <jabrahms@ebay.com>
Signed-off-by: Justin Abrahms <justin@abrah.ms>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Signed-off-by: Robert Grassian <robert.grassian@split.io>
Signed-off-by: Pramesh <p_bhandari@hotmail.com>
Co-authored-by: Todd Baert <toddbaert@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Justin Abrahms <jabrahms@ebay.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Step Security Bot <bot@stepsecurity.io>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Robert Grassian <89157164+rgrassian-split@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: Bhandari, Pramesh(AWF) <pabhandari@ebay.com>
2022-11-03 17:18:37 -07:00
.github/workflows chore(deps): update actions/cache digest to 8bec1e4 (#159) 2022-10-27 15:34:48 -04:00
docs
release
src
test-harness@5153eac71d
.clomonitor.yml
.gitattributes
.gitignore
.gitmodules
.release-please-manifest.json chore(main): release 1.0.0 (#168) 2022-10-25 11:21:02 -07:00
CHANGELOG.md chore(main): release 1.0.0 (#168) 2022-10-25 11:21:02 -07:00
CODEOWNERS
CONTRIBUTING.md
LICENSE
README.md chore(main): release 1.0.0 (#168) 2022-10-25 11:21:02 -07:00
checkstyle.xml
pom.xml fix(deps): Spot bug scope change (#173) 2022-11-03 17:18:37 -07:00
release-please-config.json
renovate.json
spec_finder.py
spotbugs-exclusions.xml
version.txt chore(main): release 1.0.0 (#168) 2022-10-25 11:21:02 -07:00

README.md

OpenFeature SDK for Java

Maven Central javadoc Project Status: Active – The project has reached a stable, usable state and is being actively developed. v0.5.1 Known Vulnerabilities on-merge codecov CII Best Practices

This is the Java implementation of OpenFeature, a vendor-agnostic abstraction library for evaluating feature flags.

We support multiple data types for flags (numbers, strings, booleans, objects) as well as hooks, which can alter the lifecycle of a flag evaluation.

This library is intended to be used in server-side contexts and has not been evaluated for use in mobile devices.

Usage

While Boolean provides the simplest introduction, we offer a variety of flag types.

import dev.openfeature.sdk.Structure;

class MyClass {
    public UI booleanExample() {
        // Should we render the redesign? Or the default webpage? 
        if (client.getBooleanValue("redesign_enabled", false)) {
            return render_redesign();
        }
        return render_normal();
    }

    public Template stringExample() {
        // Get the template to load for the custom new homepage
        String template = client.getStringValue("homepage_template", "default-homepage.html");
        return render_template(template);
    }

    public List<HomepageModule> numberExample() {
        // How many modules should we be fetching?
        Integer count = client.getIntegerValue("module-fetch-count", 4);
        return fetch_modules(count);
    }

    public HomepageModule structureExample() {
        Structure obj = client.getObjectValue("hero-module", previouslyDefinedDefaultStructure);
        return HomepageModule.builder()
                .title(obj.getValue("title"))
                .body(obj.getValue("description"))
                .build();
    }
}

For complete documentation, visit: https://docs.openfeature.dev/docs/category/concepts

Requirements

  • Java 8+

Installation

Add it to your build

Maven

<dependency>
    <groupId>dev.openfeature</groupId>
    <artifactId>sdk</artifactId>
    <version>1.0.0</version>
</dependency>

If you would like snapshot builds, this is the relevant repository information:

<repositories>
    <repository>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <id>sonartype</id>
        <name>Sonartype Repository</name>
        <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
    </repository>
</repositories>

Gradle

dependencies {
    implementation 'dev.openfeature:sdk:1.0.0'
}

Configure it

To configure it, you'll need to add a provider to the global singleton OpenFeatureAPI. From there, you can generate a Client which is usable by your code. While you'll likely want a provider for your specific backend, we've provided a NoOpProvider, which simply returns the default passed in.

class MyApp {
    public void example(){
        OpenFeatureAPI api = OpenFeatureAPI.getInstance();
        api.setProvider(new NoOpProvider());
        Client client = api.getClient();
        // Now use your `client` instance to evaluate some feature flags!
    }
}

Contacting us

We hold regular meetings which you can see here.

We are also present on the #openfeature channel in the CNCF slack.

Developing

Integration tests

The continuous integration runs a set of gherkin integration tests using flagd. These tests do not run with the default maven profile. If you'd like to run them locally, you can start the flagd testbed with docker run -p 8013:8013 ghcr.io/open-feature/flagd-testbed:latest and then run mvn test -P integration-test.

Releasing

See releasing.

Software Bill of Materials (SBOM)

We publish SBOMs with all of our releases as of 0.3.0. You can find them in Maven Central alongside the artifacts.

Contributors

Thanks so much to our contributors.

Pictures of the folks who have contributed to the project

Made with contrib.rocks.