JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.0p0 Hot Tips | CONFIDENTIAL | CodeSecure Inc |
The codesonar generate_hubbearerfile.py subcommand can be used for two different purposes:
The expected use case for this command is in deploying CodeSonar in a containerized context. You can run codesonar generate_hubbearerfile.py in a temporary container to obtain a bearer token and store it to a persistent location.
The codesonar generate_hubbearerfile.py command can be used for two different purposes:
generate_hubbearerfile.py is a codesonar Python subcommand.
There are two forms of the command line.
| Create a user session and save its bearer token. |
codesonar generate_hubbearerfile.py
[protocol://]host:port
path/to/out_bearerfile \
[-hubuser username] [-hubcacert path/to/certfile] \ [--make-dirs, --makedirs, --parent, -p] [--overwrite, -f] [--expires-in num] \ [--overflow-ok] [--keepalive, --keep-alive] \ [--note msg, --message msg, -m msg] [--pool poolname] |
| Delete a user session. |
codesonar generate_hubbearerfile.py
[protocol://]host:port
path/to/in_bearerfile \
--delete [--unlink, -u] [-hubcacert path/to/certfile] |
Use a command line of the following form to create a hub user session and save its associated bearer token to a file.
| [protocol://]host:port | The hub where the user session is to be created. |
|---|---|
| path/to/out_bearerfile |
Write the session's bearer token to the file at this
location.
|
| [-hubuser username] |
The username of the hub user account that will be the session
user.
|
| [-hubcacert path/to/certfile] |
[HTTPS hubs only] If you are using an HTTPS hub with an
untrusted hub server certificate, do the following.
|
| [--make-dirs] [--mkdirs] [--parents] [-p] |
The command will create any directories in the specified path
that do not already exist. If not specified, behavior depends on whether or not --overwrite is specified:
|
| [--overwrite] [-f] |
Any existing file at
path/to/out_bearerfile will be
overwritten. If not specified, the command will fail if file path/to/out_bearerwfile already exists. When --overwrite is specified, the command will behave as if --make-dirs is also specified. |
| [--expires-in num] |
The Expires
property for the session will initially be set to num
seconds after the current time. If not specified, the default initial Expires value will be used. If --keepalive is specified, the session Expires value may be extended when the session is used. |
| [--overflow-ok] |
If there are no available licensed session slots for the
requested session, create an overflow
session. For more information, see Session Limits. |
| [--keepalive] [--keep-alive] |
Set the session Keep
Alive? property to "true". If not specified, session Keep Alive? will be set to "false". |
| [--note msg] [--message msg] [-m msg] |
Set the session Note property to msg. The specified msg must be appropriately quoted/escaped. |
| [--pool poolname] | Set the session Pool property to poolname. |
Use a command line of the following form to delete the hub user session associated with a specified bearer file.
| [protocol://]host:port | The hub associated with the user session. |
|---|---|
| path/to/in_bearerfile | Delete the session whose bearer token is stored in this file. |
| --delete -d |
Delete the indicated user session. |
| [--unlink] [-u] |
Delete the bearer file (path/to/in_bearerfile)
after deleting the session. |
| [-hubcacert path/to/certfile] |
[HTTPS hubs only] If you are using an HTTPS hub with an
untrusted hub server certificate, do the following.
|
The expected use case for this command is in deploying CodeSonar in a containerized context.
Suppose that:
Then the general technique is as follows.
The remaining steps will refer to this location as /persistent/pathto/bearerfname.
Note: you will probably find it most convenient to store the /persistent/pathto/bearerfname string in a variable and then refer to this variable in your various commands.