diff --git a/app/src/main/resources/io/xpipe/app/resources/misc/api.md b/app/src/main/resources/io/xpipe/app/resources/misc/api.md index 032417a5..e0361cee 100644 --- a/app/src/main/resources/io/xpipe/app/resources/misc/api.md +++ b/app/src/main/resources/io/xpipe/app/resources/misc/api.md @@ -3535,7 +3535,7 @@ xor |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|*anonymous*|[Local](#schemalocal)|false|none|Authentication method for local applications. Uses file system access as proof of authentication.| +|*anonymous*|[Local](#schemalocal)|false|none|Authentication method for local applications. Uses file system access as proof of authentication.

You can find the authentication file at:
- %TEMP%\xpipe_auth on Windows
- $TMP/xpipe_auth on Linux
- $TMPDIR/xpipe_auth on macOS

For the PTB releases the file name is changed to xpipe_ptb_auth to prevent collisions.

As the temporary directory on Linux is global, the daemon might run as another user and your current user might not have permissions to access the auth file.|

ApiKey

@@ -3578,12 +3578,21 @@ API key authentication Authentication method for local applications. Uses file system access as proof of authentication. +You can find the authentication file at: +- %TEMP%\xpipe_auth on Windows +- $TMP/xpipe_auth on Linux +- $TMPDIR/xpipe_auth on macOS + +For the PTB releases the file name is changed to xpipe_ptb_auth to prevent collisions. + +As the temporary directory on Linux is global, the daemon might run as another user and your current user might not have permissions to access the auth file. +

Properties

|Name|Type|Required|Restrictions|Description| |---|---|---|---|---| |type|string|true|none|none| -|authFileContent|string|true|none|The contents of the local file $TEMP/xpipe_auth. This file is automatically generated when XPipe starts.| +|authFileContent|string|true|none|The contents of the local file /xpipe_auth. This file is automatically generated when XPipe starts.|

ClientInformation

diff --git a/core/src/main/java/io/xpipe/core/util/XPipeInstallation.java b/core/src/main/java/io/xpipe/core/util/XPipeInstallation.java index b5557c39..09b0e899 100644 --- a/core/src/main/java/io/xpipe/core/util/XPipeInstallation.java +++ b/core/src/main/java/io/xpipe/core/util/XPipeInstallation.java @@ -32,7 +32,7 @@ public class XPipeInstallation { } public static Path getLocalBeaconAuthFile() { - return Path.of(System.getProperty("java.io.tmpdir"), "xpipe_auth"); + return Path.of(System.getProperty("java.io.tmpdir"), isStaging() ? "xpipe_ptb_auth" : "xpipe_auth"); } public static String createExternalAsyncLaunchCommand( diff --git a/openapi.yaml b/openapi.yaml index d8547f80..1d77e7a5 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -55,11 +55,14 @@ paths: $ref: '#/components/schemas/HandshakeRequest' examples: standard: - summary: Standard handshake + summary: API key handshake value: { "auth": { "type": "ApiKey", "key": "" }, "client": { "type": "Api", "name": "My client name" } } local: summary: Local application handshake - value: { "auth": { "type": "Local", "authFileContent": "" }, "client": { "type": "Api", "name": "My client name" } } + value: { "auth": { "type": "Local", "authFileContent": "/xpipe_auth>" }, "client": { "type": "Api", "name": "My client name" } } + local-ptb: + summary: Local PTB application handshake + value: { "auth": { "type": "Local", "authFileContent": "/xpipe_ptb_auth>" }, "client": { "type": "Api", "name": "My client name" } } responses: '200': description: The handshake was successful. The returned token can be used for authentication in this session. The token is valid as long as XPipe is running. @@ -966,14 +969,24 @@ components: - key - type Local: - description: Authentication method for local applications. Uses file system access as proof of authentication. + description: | + Authentication method for local applications. Uses file system access as proof of authentication. + + You can find the authentication file at: + - %TEMP%\xpipe_auth on Windows + - $TMP/xpipe_auth on Linux + - $TMPDIR/xpipe_auth on macOS + + For the PTB releases the file name is changed to xpipe_ptb_auth to prevent collisions. + + As the temporary directory on Linux is global, the daemon might run as another user and your current user might not have permissions to access the auth file. type: object properties: type: type: string authFileContent: type: string - description: The contents of the local file $TEMP/xpipe_auth. This file is automatically generated when XPipe starts. + description: The contents of the local file /xpipe_auth. This file is automatically generated when XPipe starts. required: - authFileContent - type