Skip to content

Commit 084fe3e

Browse files
committed
update docs on automation and api key usage
1 parent 2d20dcc commit 084fe3e

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

tsdapiclient/guide.py

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
downloads
88
automation
99
debugging
10+
sync
11+
encryption
1012
"""
1113

1214
config = """
@@ -104,30 +106,34 @@
104106
automation = f"""
105107
To import data to your TSD project(s) in an automated way,
106108
you firstly need to organise access for your machine(s) to the TSD API,
107-
by proividing an IP address/range. If your machine(s) are located on
108-
an Uninett network, then TSD's current security policy allows
109-
enabling access without issue. You still need to contact USIT
110-
to get your IP whitelisted.
109+
by proividing an IP address/range.
111110
112-
If not, then you will have to provide a description of how you
113-
secure your machine(s) and include it in the risk analysis of your project.
111+
Given that this level of access is taken care of, you need an API key
112+
to authenticate with. There are two ways of doing this. The first and
113+
easiest way is to is to run:
114114
115-
Given that this level of access is taken care of, that you have registered tacl,
116-
and that you have obtained TSD credentials for your project(s),
117-
you can set up automated data import in the following way:
115+
tacl --register
116+
117+
and then to run:
118118
119119
tacl p11 --basic --upload myfile
120120
121-
The above example supposes that you have registered your client as
122-
described in the tacl --guide config section. This is suitable when
123-
you have a small number of clients. If, however, you have so many clients
124-
that registering them one-by-one is impractical, you can contact TSD
125-
at {HELP_URL}
126-
and request a standalone API client. This will give you an API key
127-
which you can use with tacl as such:
121+
This allows using the API key which is tied to your user to automate
122+
data imports.
123+
124+
Another use case is to use an impersonal API key, to automate
125+
data imports, and possibly exports. Contact USIT at {HELP_URL}
126+
and request a standalone API client.
127+
128+
This will give you an API key which you can use with tacl as such:
128129
129130
tacl p11 --api-key $KEY --upload myfile
130131
132+
You can also store the key in a file (only the key no newlines),
133+
and invoke tacl as such:
134+
135+
tacl p11 --api-key @path-to-file --upload myfile
136+
131137
Invoking tacl like this will over-ride any other local config.
132138
"""
133139

tsdapiclient/tacl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def construct_correct_upload_path(path: str) -> str:
465465
'--api-key',
466466
required=False,
467467
default=None,
468-
help='Pass an explicit API key - over-rides tacl config'
468+
help='Pass an explicit API key, pasting the key or as a path to a file: --api-key @path-to-file'
469469
)
470470
@click.option(
471471
'--encrypt',

0 commit comments

Comments
 (0)