Remote Server Credentials

A RemoteServerCredential is a way to store a credential for Remote Servers in a centralized vault and then reference it from Remote Server definitions.

This allows you to manage your credentials in one place and avoid duplicating them across multiple Remote Server configurations. It also enhances security by allowing you to use Terraform or APIs for Remote Server management without having to worry about credential exposure.

List Remote Server Credentials

SDK Method

remoteservercredential.List()

Return Object

[]*RemoteServerCredential

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    remote_server_credential "github.com/Files-com/files-sdk-go/v3/remoteservercredential"
)

remoteServerCredentialIterator, err := remote_server_credential.List(files_sdk.RemoteServerCredentialListParams{})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

for remoteServerCredentialIterator.Next() {
    remoteServerCredential := remoteServerCredentialIterator.remoteServerCredential()
}
err = remoteServerCredentialIterator.Err()
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Show Remote Server Credential

SDK Method

remoteservercredential.Find()

Return Object

RemoteServerCredential

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

RemoteServerCredentialFindParams Fields

FieldDescription
Id
int64
Required
Remote Server Credential ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    remote_server_credential "github.com/Files-com/files-sdk-go/v3/remoteservercredential"
)

remoteServerCredential, err := remote_server_credential.Find(files_sdk.RemoteServerCredentialFindParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Create Remote Server Credential

SDK Method

remoteservercredential.Create()

Return Object

RemoteServerCredential

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

RemoteServerCredentialCreateParams Fields

FieldDefaultDescription
Name
string
Internal name for your reference
Description
string
Internal description for your reference
ServerType
string
Remote server type. Remote Server Credentials are only valid for a single type of Remote Server.
Possible values: ftp, sftp, s3, google_cloud_storage, webdav, wasabi, backblaze_b2, one_drive, box, dropbox, google_drive, azure, sharepoint, s3_compatible, azure_files, files_agent, filebase, cloudflare, linode, files_com
AwsAccessKey
string
AWS Access Key.
S3AssumeRoleArn
string
AWS IAM Role ARN for AssumeRole authentication.
S3AssumeRoleDurationSeconds
int64
Session duration in seconds for AssumeRole authentication (900-43200).
CloudflareAccessKey
string
Cloudflare: Access Key.
FilebaseAccessKey
string
Filebase: Access Key.
GoogleCloudStorageS3CompatibleAccessKey
string
Google Cloud Storage: S3-compatible Access Key.
LinodeAccessKey
string
Linode: Access Key
S3CompatibleAccessKey
string
S3-compatible: Access Key
SharepointClientId
string
SharePoint: Microsoft Entra application client ID for app-only authentication.
SharepointTenantId
string
SharePoint: Microsoft Entra tenant ID for app-only authentication.
Username
string
Remote server username.
WasabiAccessKey
string
Wasabi: Access Key.
Password
string
Password, if needed.
PrivateKey
string
Private key, if needed.
PrivateKeyPassphrase
string
Passphrase for private key if needed.
AwsSecretKey
string
AWS: secret key.
AzureBlobStorageAccessKey
string
Azure Blob Storage: Access Key
AzureBlobStorageSasToken
string
Azure Blob Storage: Shared Access Signature (SAS) token
AzureFilesStorageAccessKey
string
Azure File Storage: Access Key
AzureFilesStorageSasToken
string
Azure File Storage: Shared Access Signature (SAS) token
BackblazeB2ApplicationKey
string
Backblaze B2 Cloud Storage: applicationKey
BackblazeB2KeyId
string
Backblaze B2 Cloud Storage: keyID
CloudflareSecretKey
string
Cloudflare: Secret Key
FilebaseSecretKey
string
Filebase: Secret Key
GoogleCloudStorageCredentialsJson
string
Google Cloud Storage: JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
GoogleCloudStorageS3CompatibleSecretKey
string
Google Cloud Storage: S3-compatible secret key
LinodeSecretKey
string
Linode: Secret Key
S3CompatibleSecretKey
string
S3-compatible: Secret Key
SharepointClientCertificate
string
SharePoint: PEM-encoded certificate and unencrypted private key for app-only authentication.
SharepointClientSecret
string
SharePoint: Microsoft Entra application client secret for app-only authentication.
WasabiSecretKey
string
Wasabi: Secret Key
WorkspaceId
int64
0Workspace ID (0 for default workspace)
CopyValuesFromCredentialId
int64
ID of Remote Server Credential to copy omitted values from.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    remote_server_credential "github.com/Files-com/files-sdk-go/v3/remoteservercredential"
)

remoteServerCredential, err := remote_server_credential.Create(files_sdk.RemoteServerCredentialCreateParams{Name: "My Credential"})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Update Remote Server Credential

SDK Method

remoteservercredential.Update()

Return Object

RemoteServerCredential

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

RemoteServerCredentialUpdateParams Fields

FieldDescription
Id
int64
Required
Remote Server Credential ID.
Name
string
Internal name for your reference
Description
string
Internal description for your reference
ServerType
string
Remote server type. Remote Server Credentials are only valid for a single type of Remote Server.
Possible values: ftp, sftp, s3, google_cloud_storage, webdav, wasabi, backblaze_b2, one_drive, box, dropbox, google_drive, azure, sharepoint, s3_compatible, azure_files, files_agent, filebase, cloudflare, linode, files_com
AwsAccessKey
string
AWS Access Key.
S3AssumeRoleArn
string
AWS IAM Role ARN for AssumeRole authentication.
S3AssumeRoleDurationSeconds
int64
Session duration in seconds for AssumeRole authentication (900-43200).
CloudflareAccessKey
string
Cloudflare: Access Key.
FilebaseAccessKey
string
Filebase: Access Key.
GoogleCloudStorageS3CompatibleAccessKey
string
Google Cloud Storage: S3-compatible Access Key.
LinodeAccessKey
string
Linode: Access Key
S3CompatibleAccessKey
string
S3-compatible: Access Key
SharepointClientId
string
SharePoint: Microsoft Entra application client ID for app-only authentication.
SharepointTenantId
string
SharePoint: Microsoft Entra tenant ID for app-only authentication.
Username
string
Remote server username.
WasabiAccessKey
string
Wasabi: Access Key.
Password
string
Password, if needed.
PrivateKey
string
Private key, if needed.
PrivateKeyPassphrase
string
Passphrase for private key if needed.
AwsSecretKey
string
AWS: secret key.
AzureBlobStorageAccessKey
string
Azure Blob Storage: Access Key
AzureBlobStorageSasToken
string
Azure Blob Storage: Shared Access Signature (SAS) token
AzureFilesStorageAccessKey
string
Azure File Storage: Access Key
AzureFilesStorageSasToken
string
Azure File Storage: Shared Access Signature (SAS) token
BackblazeB2ApplicationKey
string
Backblaze B2 Cloud Storage: applicationKey
BackblazeB2KeyId
string
Backblaze B2 Cloud Storage: keyID
CloudflareSecretKey
string
Cloudflare: Secret Key
FilebaseSecretKey
string
Filebase: Secret Key
GoogleCloudStorageCredentialsJson
string
Google Cloud Storage: JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
GoogleCloudStorageS3CompatibleSecretKey
string
Google Cloud Storage: S3-compatible secret key
LinodeSecretKey
string
Linode: Secret Key
S3CompatibleSecretKey
string
S3-compatible: Secret Key
SharepointClientCertificate
string
SharePoint: PEM-encoded certificate and unencrypted private key for app-only authentication.
SharepointClientSecret
string
SharePoint: Microsoft Entra application client secret for app-only authentication.
WasabiSecretKey
string
Wasabi: Secret Key

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    remote_server_credential "github.com/Files-com/files-sdk-go/v3/remoteservercredential"
)

remoteServerCredential, err := remote_server_credential.Update(files_sdk.RemoteServerCredentialUpdateParams{
  Id: 1,
  Name: "My Credential"
})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Delete Remote Server Credential

SDK Method

remoteservercredential.Delete()

Return Object

No return value.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

RemoteServerCredentialDeleteParams Fields

FieldDescription
Id
int64
Required
Remote Server Credential ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    remote_server_credential "github.com/Files-com/files-sdk-go/v3/remoteservercredential"
)

err := remote_server_credential.Delete(files_sdk.RemoteServerCredentialDeleteParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

The RemoteServerCredential Object

Some of the methods above return a RemoteServerCredential object. The attributes of this object are listed below.

AttributeDescription
Id
int64
Remote Server Credential ID
WorkspaceId
int64
Workspace ID (0 for default workspace)
Name
string
Internal name for your reference
Description
string
Internal description for your reference
ServerType
string
Remote server type. Remote Server Credentials are only valid for a single type of Remote Server.
Possible values: ftp, sftp, s3, google_cloud_storage, webdav, wasabi, backblaze_b2, one_drive, box, dropbox, google_drive, azure, sharepoint, s3_compatible, azure_files, files_agent, filebase, cloudflare, linode, files_com
AwsAccessKey
string
AWS Access Key.
S3AssumeRoleArn
string
AWS IAM Role ARN for AssumeRole authentication.
S3AssumeRoleDurationSeconds
int64
Session duration in seconds for AssumeRole authentication (900-43200).
S3AssumeRoleExternalId
string
External ID for AssumeRole authentication.
GoogleCloudStorageS3CompatibleAccessKey
string
Google Cloud Storage: S3-compatible Access Key.
WasabiAccessKey
string
Wasabi: Access Key.
S3CompatibleAccessKey
string
S3-compatible: Access Key
FilebaseAccessKey
string
Filebase: Access Key.
CloudflareAccessKey
string
Cloudflare: Access Key.
LinodeAccessKey
string
Linode: Access Key
SharepointTenantId
string
SharePoint: Microsoft Entra tenant ID for app-only authentication.
SharepointClientId
string
SharePoint: Microsoft Entra application client ID for app-only authentication.
SharepointAppCredentialType
string
SharePoint: App-only credential type. Either secret or certificate.
Username
string
Remote server username.