Skip to content

Commit

Permalink
feat: extract wasm tar in /jans-tarp folder (#10689)
Browse files Browse the repository at this point in the history
* feat: extract wasm tar in /jans-tarp folder

Signed-off-by: Arnab Dutta <arnab.bdutta@gmail.com>

* ci: fix versions

Signed-off-by: moabu <47318409+moabu@users.noreply.github.com>

---------

Signed-off-by: Arnab Dutta <arnab.bdutta@gmail.com>
Signed-off-by: moabu <47318409+moabu@users.noreply.github.com>
Co-authored-by: moabu <47318409+moabu@users.noreply.github.com>
  • Loading branch information
duttarnab and moabu authored Jan 20, 2025
1 parent d76f28c commit ca8f453
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,10 @@ jobs:
TAG="0.0.0"
fi
wget https://github.com/${{ github.repository }}/releases/download/"${VER}"/cedarling_wasm_"${TAG}"_pkg.tar.gz -O cedarling_wasm.tar.gz
mkdir -p src/wasm
tar -xvf cedarling_wasm.tar.gz -C src/wasm
mkdir -p wasm
tar -xvf cedarling_wasm.tar.gz -C wasm
rm cedarling_wasm.tar.gz
ls src/wasm
ls wasm
# END Get the latest cedarling wasm package
npm install
npm run build
Expand Down
4 changes: 2 additions & 2 deletions demos/jans-tarp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jans-tarp",
"version": "0.0.0-nightly",
"version": "0.0.0",
"description": "Relying Party tool in form of a Chrome Extension.",
"main": "index.js",
"license": "Apache",
Expand Down Expand Up @@ -50,6 +50,6 @@
"react-spinner-overlay": "^0.1.33",
"styled-components": "^6.1.0",
"uuid": "^9.0.0",
"wasm": "file:src/wasm"
"wasm": "file:wasm"
}
}
5 changes: 3 additions & 2 deletions demos/jans-tarp/src/options/userDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import AccordionDetails from '@mui/material/AccordionDetails';
import Typography from '@mui/material/Typography';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';

import __wbg_init, { init, Cedarling, AuthorizeResult } from "wasm";
import __wbg_init, { init, Cedarling, AuthorizeResult } from 'wasm';

const UserDetails = ({ data, notifyOnDataChange }) => {
const [loading, setLoading] = useState(false);
Expand Down Expand Up @@ -61,9 +61,10 @@ const UserDetails = ({ data, notifyOnDataChange }) => {
await __wbg_init();
instance = await init(!isEmpty(cedarlingConfig?.cedarlingConfig) ? cedarlingConfig?.cedarlingConfig[0] : undefined);
let result: AuthorizeResult = await instance.authorize(reqObj);
let logs = await instance.pop_logs();
setAuthzResult(result.json_string())
console.log("result:", result);
let logs = await instance.pop_logs();
logs.push(await instance.pop_logs());
if (logs.length != 0) {
let pretty_logs = logs.map(log => JSON.stringify(log, null, 2));
setAuthzLogs(pretty_logs.toString());
Expand Down
2 changes: 1 addition & 1 deletion demos/jans-tarp/src/static/chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "jans-tarp",
"version": "0.0.0-nightly",
"version": "0.0.0",
"version_name": "nightly",
"description": "Relying Party tool in form of a Chrome Extension. Please note that the manifest version field should be one to four dot-separated integers identifying the version of this extension. The descriptive version string can be stated in the `version_name` field. For more details see https://developer.chrome.com/docs/extensions/reference/manifest/version.",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion demos/jans-tarp/src/static/firefox/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "jans-tarp",
"version": "0.0.0-nightly",
"version": "0.0.0",
"description": "Relying Party tool in form of a Firefox Extension.",
"icons": {
"16": "icon.png",
Expand Down

0 comments on commit ca8f453

Please sign in to comment.