By default, the Nodes that can be referenced by a Processing & Logic program are limited to the same Workspace as that program.
However, if your program has a need to reference Nodes in other Workspaces, there is a way to achieve this.
Node paths that reference a Workspace which is not the current Workspace will require additional authorisation. This is done using the AUTH function, which must be used in your program before specifying the Node path. The AUTH function requires two inputs:
AUTH( , )
The slug is a code which uniquely identifies an account, and can always be seen in the URL; for example, in the following URL, the slug is abc123:
https://eagle.io/ui/abc123/myWorkspace
The api-key must be an API key which has access to the Workspace that you intend to reference in a Node path.
In the following example, I have a Processor in the "Project 1" Workspace, but I want to reference the temperature of a logger in the "Project 2" Workspace. First, I must create an API key that allows access to "Project 2":
To follow security best practices, the API key only has the privileges required for this particular task; it only allows read-only access to the "Project 2" Workspace.
Now I can create a Processor in the "Project 1" Workspace, and paste the API key I just created into the AUTH function:
This Processor will access the temperature of my logger in the "Project 2" Workspace, and output the value converted to Fahrenheit.
Note that if the AUTH function is commented out, the reference to the "Project 2" Workspace on line 5 will cause a compile error "Node referenced is not accessible", because by default the program is not authorised to access Nodes outside of it's own "Project 1" Workspace:
Full details of the AUTH function can be found in the docs at http://docs.eagle.io/en/latest/topics/processing_and_logic/index.html#workspace-authorisation
Comments
0 comments
Article is closed for comments.