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

DM-40764: Set access_url to xtype clob #137

Merged
merged 1 commit into from Sep 21, 2023
Merged

DM-40764: Set access_url to xtype clob #137

merged 1 commit into from Sep 21, 2023

Conversation

cbanek
Copy link
Contributor

@cbanek cbanek commented Sep 20, 2023

So there's this special datatype called clob. You can look up the full reference here:

https://www.ivoa.net/documents/ADQL/20180112/PR-ADQL-2.1-20180112.html

Section 3.4.2

So it's just like a character type or a unicode type, but the special part with a clob is that the value is generated by the server, not just stored in a database. This is a bit complicated but it makes sense after thinking about it for a minute. Since the TAP service is going to be making changes to the access_url column stored in the database, it means you can't use an ADQL query through the TAP service on that column. This is because the ADQL (SQL) query is run before the TAP server modifies the return / generates the field, then any kind of restrictions (like a LIKE) will be 'ignored'. So by setting to this type, it should prevent queries that filter on the column, but not blocking returning that column.

clob is the type of the access_url since the TAP server will be changing the value to put the correct hostname in the URL. That means nobody can say access_url like '%data-int.lsst.cloud%'

When a field is this type, then additional code paths are exercised in the TAP service Formatter code, where we change the host in the URL we return (but keep the path).

So there's this special datatype called clob.  You can look up
the full reference here:

https://www.ivoa.net/documents/ADQL/20180112/PR-ADQL-2.1-20180112.html

Section 3.4.2

So it's just like a character type or a unicode type, but the
special part with a clob is that the value is generated by
the server, not just stored in a database.  This is a bit
complicated but it makes sense after thinking about it for
a minute.  Since the TAP service is going to be making changes
to the access_url column stored in the database, it means
you can't use an ADQL query through the TAP service on that
column.  This is because the ADQL (SQL) query is run before
the TAP server modifies the return / generates the field,
then any kind of restrictions (like a LIKE) will be
'ignored'.  So by setting to this type, it should prevent
queries that filter on the column, but not blocking
returning that column.

clob is the type of the access_url since the TAP server
will be changing the value to put the correct hostname
in the URL.  That means nobody can say access_url like
'%data-int.lsst.cloud%'

When a field is this type, then additional code paths
are exercised in the TAP service Formatter code, where
we change the host in the URL we return (but keep the
path).
@cbanek cbanek merged commit 679c361 into main Sep 21, 2023
4 of 5 checks passed
@cbanek cbanek deleted the tickets/DM-40764 branch September 21, 2023 00:45
@mwittgen mwittgen changed the title [DM-40764] Set access_url to xtype clob DM-40764: Set access_url to xtype clob Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant