Skip to content

implement VOSI permissions using headers#256

Merged
pdowler merged 17 commits into
opencadc:mainfrom
pdowler:vosi-permissions
Jun 18, 2026
Merged

implement VOSI permissions using headers#256
pdowler merged 17 commits into
opencadc:mainfrom
pdowler:vosi-permissions

Conversation

@pdowler

@pdowler pdowler commented May 29, 2026

Copy link
Copy Markdown
Member

retain the deprecated /permissions endpoint

pdowler added 15 commits May 13, 2026 14:10
cadc-tap_schema: compute and assign "size" when possible
hack: accept literal value of "null" to remove a grant
…l value

always get schema and table permissions in get methods
this is to allow a pure http header POST (permissions)
updates to handle null TapPermissions.isPublic correctly
set schema and table permissions using http headers (VOSI)
fix some tests that assumed specific permissions
simplify vosi permissions via headers to implement openapi spec
try {
return Integer.parseInt(s);
} catch (NumberFormatException ex) {
throw new RuntimeException("BUG: failed to convert arraysize '" + arraysize

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it has to be(most probably) a mistake of a user sending for example "foo" or "10*10"... so I think it should be throwing IllegalArgException instead of RuntimeException.

Aside, I am updating the exception handling part to give user informative message so throwing IllegalArgException will help.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input arraysize is validated by the VOTableReader using VOTableUtil.getArrayShape(String) and that does throw IllegalArgumentException, so here we only need to deal with valid values. I suppose I could explicitly call getArrayShape (again) and look for an int[1] result.

I changed the method to call getArrayShape and it's simpler (a bit funky) and doesn't have any bugs to detect :-)

@pdowler pdowler merged commit c28e37f into opencadc:main Jun 18, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants