Chapter 72. Example relational data resource client using GT security

72.1. How to run the client using message level security with GSI secure conversation
72.2. How to run the client using transport level security

OGSA-DAI provides a simple command-line client for running requests involving relational data resources. This uses the SQLQuery, TupleToWebRowSetCharArrays, CharArraysResize and DeliverToRequestStatus activities. The query results are pretty-printed.

The secure relational client is an extension of the example SQL client (Chapter 71, Example relational data resource client) which allows various Globus Toolkit security settings to be used to secure communications between the client and the server. It is a useful program to check that server security is configured correctly. You use either transport level security or message level security with secure conversation. Both security options provide message integrity by default but can be specified to additionally provide message privacy using encryption. Both security options use host authorization to authorize the server.

[Note]Note
OGSA-DAI example clients are intended to allow users to quickly test their deployment as well to provide basic examples of how to construct clients using the client toolkit. They are not intended to be robust applications for use in production environments. OGSA-DAI offers a toolkit which provides users with the tools to develop their own clients that use OGSA-DAI services - these clients are the simplest examples built using this toolkit.

The client takes the following arguments:

[Caution]Caution
The client should be run in the $OGSADAI_HOME directory or you should make sure that the directory $OGSADAI_HOME/deploy is in your CLASSPATH (the client-config.wsdd file in that directory is necessary).

72.1. How to run the client using message level security with GSI secure conversation

Run the following, replacing SERVICES-BASE-URL, DATA-RESOURCE-ID, QUERY and, if required DRER-ID.

$ java uk.org.ogsadai.client.toolkit.gt.example.GTSecureSQLClient \
  -u SERVICES-BASE-URL [-e DRER-ID] -d DATA-RESOURCE-ID  \ 
  -q QUERY -secconv [encrypt]

The default of message integrity is enforced. If the encrypt flag is provided then message privacy is enforced.

For example:

$ java uk.org.ogsadai.client.toolkit.gt.example.GTSecureSQLClient \
 -u http://coal.epcc.ed.ac.uk:8080/wsrf/services/dai/ -d MyOwnSQLDataResource \
 -q "SELECT * FROM littleblackbook WHERE id < 10;" \
 -secconv

$ java uk.org.ogsadai.client.toolkit.gt.example.GTSecureSQLClient \
 -u http://coal.epcc.ed.ac.uk:8080/wsrf/services/dai/ -d MyOwnSQLDataResource \
 -q "SELECT * FROM littleblackbook WHERE id < 10;" \
 -secconv encrypt

72.2. How to run the client using transport level security

Run the following, replacing SERVICES-BASE-URL, DATA-RESOURCE-ID and, if required DRER-ID. QUERY should be replaced by your query.

$ java uk.org.ogsadai.client.toolkit.gt.example.GTSecureSQLClient \
  -u SERVICES-BASE-URL [-e DRER-ID] -d DATA-RESOURCE-ID  \ 
  -q QUERY -tls [encrypt]

As transport level security is being used you should use https (and not http) in your URL.

The default of message integrity is enforced. If the encrypt flag is provided then message privacy is enforced.

For example:

$ java uk.org.ogsadai.client.toolkit.gt.example.GTSecureSQLClient \
 -u https://coal.epcc.ed.ac.uk:8443/wsrf/services/dai/ -d MyOwnSQLDataResource \
 -q "SELECT * FROM littleblackbook WHERE id < 10;" \
 -tls

$ java uk.org.ogsadai.client.toolkit.gt.example.GTSecureSQLClient \
 -u https://coal.epcc.ed.ac.uk:8443/wsrf/services/dai/ -d MyOwnSQLDataResource \
 -q "SELECT * FROM littleblackbook WHERE id < 10;" \
 -tls encrypt