Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do we need types in the Fapi Policy Generator #56

Open
williamcroberts opened this issue Nov 18, 2020 · 1 comment
Open

Do we need types in the Fapi Policy Generator #56

williamcroberts opened this issue Nov 18, 2020 · 1 comment
Assignees

Comments

@williamcroberts
Copy link
Member

For things like numbers, why do we need the type selectors of hex or UINT32? These seem to do nothing as the data is dropped as is and quoted in the JSON policy. So it ends up as a string anyways. Wouldn't something like "0x30", "48", and "060" convert the same with strtoul semantics and base set to 0? If you want the type to be input natively as a json number I think only base10 is allowed so the tool can just take the value as a string, plop it through strtoul with base 0 and then output it in the json unquoted.

why-types

@AndreasFuchsTPM
Copy link
Member

AndreasFuchsTPM commented Nov 19, 2020

The Question is, what happens when someone pastes an existing JSON policy containing a JSON-INT into the bottom field and hit's "update editor", since in that case the pasted JSON policy would be invalid wrt the schema.
Need to be tested though...

P.S. In the spec we specified that JSON-INT would be the "normal form", so that's what fapi will produce on export.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants