Skip to content

das2c_credsave

C. Piker edited this page Dec 12, 2023 · 1 revision

FUNCTION

das2c_credsave

PURPOSE

Save server credentials and URL match conditions

CALLING SEQUENCE

num_creds = das2c_credsave()
num_creds = das2c_credsave(filename)
num_creds = das2c_credsave(filename, symetric_key)  ; TODO

OPTIONAL INPUTS

Parameter Type Purpose
filename String

!NULL

The full path to the file where credentials and match conditions are saved. If not provided $HOME/.das2_auth or %USERPROFILE%/.das2_auth is used. For interoperability, this is the same file name used by das2py

The default location can also be indicated by using !NULL for this input.

symetric_key

(TODO)

String A password used to encrypt and decrypt the credentials file.

This is not yet implemented in das2C, but is documented here to indicate planned development

OUTPUT

Returns the number of credentials saved

SIDE EFFECTS

The current credential set in memory is written to the file. This could overwrite previous entries if das2c_credload has not been called on the same file.

EXAMPLES

  1. Save authentication tokens and server match criteria in the default location:

    nCreds = das2c_credsave()
  2. Create and save an auth token in a non-default location:

    sURL = 'https://planet.physics.uiowa.edu/test/server/'
    sRealm = 'Realm of Makebelieve'
    sDataset = 'test/newsource'
    sUser = 'drjfever'
    sPass = 'really~4disco'
    nCreds = das2c_credsave(sUrl, sRealm, sDataset, sUser, sPass)
    nCreds = das2c_credsave('/home/someone/.test_auth')

MODIFICATION HISTORY

C. Piker, 2023-12-12 - Initial Version

Clone this wiki locally