Skip to content

Commit

Permalink
feat(jans-lock): extend infrastructure for cedarling (#8760)
Browse files Browse the repository at this point in the history
* feat(jans-lock): further infrastructure for cedarling

Signed-off-by: sokorototo <nyachiengatoto@gmail.com>

* chore(jans-lock): cleaned up commit

Signed-off-by: sokorototo <nyachiengatoto@gmail.com>

* feat(jans-lock): Parse policy store as JSON instead of ZIP

Signed-off-by: sokorototo <nyachiengatoto@gmail.com>

* chore(jans-lock): Massively improved project structure

Signed-off-by: sokorototo <nyachiengatoto@gmail.com>

* chore(jans-lock): Further improved project structure

Signed-off-by: sokorototo <nyachiengatoto@gmail.com>

* choree(jans-lock): Fixed cargo clippy complaints on cedarling

Signed-off-by: sokorototo <nyachiengatoto@gmail.com>

---------

Signed-off-by: sokorototo <nyachiengatoto@gmail.com>
Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com>
  • Loading branch information
sokorototo and moabu committed Jun 25, 2024
1 parent cfdf223 commit ee03f44
Show file tree
Hide file tree
Showing 21 changed files with 918 additions and 254 deletions.
1 change: 1 addition & 0 deletions jans-lock/cedarling/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
/meta
/.vscode
/samples
54 changes: 17 additions & 37 deletions jans-lock/cedarling/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions jans-lock/cedarling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,34 @@ version = "0.1.0"
edition = "2021"

[dependencies]
brotli = "6.0.0"
cedar-policy = { version = "3.2.0", features = ["wasm"] }
console_error_panic_hook = "0.1.7"
static-toml = { version = "1.2.0", default-features = false }
miniz_oxide = { version = "0.7.4", default-features = false, features = [
"with-alloc",
] }

# serde
serde = { version = "*", features = ["derive"] }
serde_json = "1.0.117"

# Environment Dependencies
console_error_panic_hook = "0.1.7"
serde-wasm-bindgen = "0.6.5"
static-toml = "1.2.0"
wasm-bindgen = "0.2.92"
wasm-bindgen-futures = "0.4.42"

[dependencies.web-sys]
version = "0.3.69"
features = [
'console',
'Window',
'Response',
'Request',
'Headers',
'RequestMode',
'RequestInit',
'EventSource',
'MessageEvent',
'UrlSearchParams',
]

[dev-dependencies]
Expand Down
5 changes: 5 additions & 0 deletions jans-lock/cedarling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## cedarling

The `cedarling` is an embeddable Webassembly Component that runs a local Cedar Engine, enabling fine grained and responsive Policy Management on the Web. The `cedarling` allows for dynamic updates to it's internal Policy Store via Server Sent events, enabling sub-second Access Management.

### How it works
25 changes: 19 additions & 6 deletions jans-lock/cedarling/config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
schema_url = "https://api.github.com/repos/nynymike/cedar-playground/contents/gluu_lock.cedarschema?ref=main"
# https://github.com/JanssenProject/jans/wiki/Cedarling-Nativity-Plan#bootstrap-properties

# Policy Store Settings
[policy_store]
use_static_store = false
remote_uri = "https://api.github.com/repos/nynymike/cedar-playground/contents/gluu_lock.cedarschema?ref=main"
use_brotli_decompression = false # Whether the policy store is to be decopmressed using Brotli
# Whether policy store should be decompressed using deflate
decompress-policy-store = false

# Self explanatory
openid-config-url = "https://account.gluu.org/.well-known/openid-configuration"

# whether Cedarling should listen for SSE config updates
dynamic-configuration = false

[policy-store]
# How to get policy store, can be local, remote or lock-master
strategy = "local"
uri = "https://api.github.com/repos/nynymike/cedar-playground/contents/gluu_lock.cedarschema?ref=main"

[lock-master]
url = "*"
ssa_jwt = "eyJhbG"
policy_store_id = "test#5"
Empty file removed jans-lock/cedarling/policies.store
Empty file.
Loading

0 comments on commit ee03f44

Please sign in to comment.