Releases: StyraInc/opa-typescript
@styra/[email protected]
Patch Changes
-
be7bcb5:
AuthzProviderContext
is a type now (was interface)This was done to remove code duplication. No functional changes. But since the
interface was exported before, some care might have to be taken when updating.
@styra/[email protected]
Minor Changes
-
d2b2abc: Add
fromResults
to support unwrapping policy evaluation resultsThis allows us to unwrap results returned from OPA to turn them into a boolean.
Previously, anything different from undefined and false was taken to mean "authorized". Now, we can work with policy evaluation results like
{ "result": false, "details": "..." }
by providing a
fromResults
function likeconst fromResults = (r?: Result): boolean => ((r as Record<string, any>)["foobar"] as boolean) ?? false;
As with input and path, this can (optionally) be set with
<AuthzProvider>
(propertydefaultFromResults
), and with<Authz>
(propertyfromResult
), or passed touseAuthz()
.
@styra/[email protected]
Patch Changes
- 6365272: Update README for v0.2.0 change
@styra/[email protected]
Minor Changes
-
aa75275: Remove function support from component
Allowing a function had unintended consequences for performance, given how
React works. Now, there is only one way to do it:fallback
for non-truthy
results, andchildren
for truthy results.
@styra/[email protected]
Minor Changes
-
f7eab9c: Remove default export: It seems simpler to only rely on the three exports we have:
import { AuthzProvider } from "@styra/opa-react";
import { Authz } from "@styra/opa-react";
import { useAuthz } from "@styra/opa-react";
(Besides types and interfaces.)
@styra/[email protected]
Patch Changes
- 906a90c: build packages when publishing
@styra/[email protected]
Patch Changes
- 770d833: fix dist/ missing in package
@styra/[email protected]
Patch Changes
-
ab7c009: Fix package.json (add "browser" next to "main")
Before, create-react-app (or webpack, rather) failed to resolve @styra/opa-react.
@styra/[email protected]
Patch Changes
- 0e74573: Initial Release