nimblebox logo
Docs
v2.1.0

nbox.auth

This code is used to manage the authentication of the entire nbox package. For authentication it will create a .nbx in the user's home directory (~/.nbx, in case of linux) and store a file called secrets.json. This folder will also contain more information and files that are used elsewhere as well ex. files generated when takling to any instance.

Users can chose to set configs at a global level for convenience. Here's a list of configs that can be set:

global.workspace_id = '' # this will set the default workspace id for all commands, users can override this by passing the --workspace-id flag

Functions

iconfunctioninit_secret
[source]

Initialize the secret object. This is a singleton object that can be used across multiple processes.

Classes

iconclassConfigString
[source]
iconfunctionitems
[source]
iconclassNBXClient
[source]
iconfunction__init__
[source]

Single source for all the secrets file. Can persist across multiple processes.

iconfunction__repr__
[source]
iconfunctionget
[source]
(item:str,default:any,reload:bool)
Parameters
  • item -

    The item to get the value for

  • default -

    The default value to return if the item is not found

  • reload -

    If True, reload the secrets file before getting the value

Get the value of the item from the secrets file.

Returns:

  • any: The value of the item or the default value if the item is not found
iconfunctionput
[source]
(item:str,value:any,persist:bool)
Parameters
  • item -

    The item to put the value for

  • value -

    The value to put

  • persist -

    If True, persist the secrets file after putting the value

Put the value of the item in the secrets file.

nbox SDKnbox provides built in access to all the APIs and packages them in the most user friendly manner.Star 0