Documentation ¶
Overview ¶
Package consts is only for declaring some constants used by the stack, like some slugs, IDs, doctypes, etc.
Index ¶
Constants ¶
const ( // StoreSlug is the slug of the store application: it can install // konnectors and applications. StoreSlug = "store" // HomeSlug is the slug of the default app, where the user is redirected // after login. HomeSlug = "home" // SettingsSlug is the slug of the settings application. SettingsSlug = "settings" // DriveSlug is the slug of the drive app, where the user can be sent if // the disk quota alert is raised. DriveSlug = "drive" // NotesSlug is the slug of notes app, which is used by the stack for // referencing a directory that contains the notes with collaborative // edition. NotesSlug = "notes" // PassSlug is the slug of cozy-pass webapp, which is used by the stack for // linking the bitwarden OAuth clients. PassSlug = "passwords" // DataProxySlug is the slug of the dataproxy webapp, which is used for // embedding a PouchDB in the client (used by the search for example). DataProxySlug = "dataproxy" )
const ( // BitwardenSettingsID is the id of the settings document for bitwarden BitwardenSettingsID = "io.cozy.settings.bitwarden" // ContextSettingsID is the id of the settings JSON-API response for the context ContextSettingsID = "io.cozy.settings.context" // ClientsUsageID is the id of the settings JSON-API response for clients-usage ClientsUsageID = "io.cozy.settings.clients-usage" // DiskUsageID is the id of the settings JSON-API response for disk-usage DiskUsageID = "io.cozy.settings.disk-usage" // InstanceSettingsID is the id of settings document for the instance InstanceSettingsID = "io.cozy.settings.instance" // CapabilitiesSettingsID is the id of the settings document with the // capabilities for a given instance CapabilitiesSettingsID = "io.cozy.settings.capabilities" // ExternalTiesID is the id of the settings document with the external ties // for a given instance ExternalTiesID = "io.cozy.settings.external-ties" // PassphraseParametersID is the id of settings document for the passphrase // parameters used to hash the master password on client side. PassphraseParametersID = "io.cozy.settings.passphrase" // FlagsSettingsID is the id of settings document with the feature flags. FlagsSettingsID = "io.cozy.settings.flags" // InstanceFlagsSettingsID is the id of the settings documents with the // feature flags specific to this instance. InstanceFlagsSettingsID = "io.cozy.settings.flags.instance" // ManagerFlagsSettingsID is the id of the settings documents with the // feature flags coming from the manager (via the feature sets). ManagerFlagsSettingsID = "io.cozy.settings.flags.manager" // ConfigFlagsSettingsID is the id of the settings documents with the // feature flags defined in the contexts section of the configuration file. ConfigFlagsSettingsID = "io.cozy.settings.flags.config" // ContextFlagsSettingsID is the id of the settings documents with the // feature flags defined with a ratio on the contexts. ContextFlagsSettingsID = "io.cozy.settings.flags.context" // DefaultFlagsSettingsID is the id of the settings documents with the // default feature flags. DefaultFlagsSettingsID = "io.cozy.settings.flags.default" )
const ( // BitwardenCozyOrganizationName is the name of the organization used to // share passwords between Cozy and Bitwarden clients. BitwardenCozyOrganizationName = "Cozy" // BitwardenCozyCollectionName is the name of the collection used to // share passwords between Cozy and Bitwarden clients. BitwardenCozyCollectionName = "Cozy Connectors" // BitwardenProtocol is the name of the bitwarden protocol BitwardenProtocol = "Bitwarden" // BitwardenCipherRelationship is the name of the account-cipher relationship BitwardenCipherRelationship = "vaultCipher" )
const ( // Apps doc type for client-side application manifests Apps = "io.cozy.apps" // AppsSuggestion doc type for suggesting apps to the user AppsSuggestion = "io.cozy.apps.suggestions" // AppsOpenParameters doc type for the parameters used by the flagship to // open a webapp AppsOpenParameters = "io.cozy.apps.open" // AppLogs doc type for logs sent by apps and konnectors AppLogs = "io.cozy.apps.logs" // Konnectors doc type for konnector application manifests Konnectors = "io.cozy.konnectors" // KonnectorsMaintenance doc type for maintenance of konnectors. KonnectorsMaintenance = "io.cozy.konnectors.maintenance" // Archives doc type for zip archives with files and directories Archives = "io.cozy.files.archives" // Exports doc type for global exports archives Exports = "io.cozy.exports" // ExportsRequests doc type for a request to move to another Cozy ExportsRequests = "io.cozy.exports.requests" // Imports doc type for global exports archives Imports = "io.cozy.imports" // Doctypes doc type for doctype list Doctypes = "io.cozy.doctypes" // Files doc type for type for files and directories Files = "io.cozy.files" // FilesMetadata doc type for metadata of files FilesMetadata = "io.cozy.files.metadata" // FilesVersions doc type for versioning file contents FilesVersions = "io.cozy.files.versions" // FilesShortcuts doc type for high-level information about .url files FilesShortcuts = "io.cozy.files.shortcuts" // Thumbnails is a synthetic doctype for thumbnails, used for realtime // events Thumbnails = "io.cozy.files.thumbnails" // CertifiedCarbonCopy is a synthetic doctype, used for given permission to // add the carbonCopy metadata on files CertifiedCarbonCopy = "io.cozy.certified.carbon_copy" // CertifiedElectronicSafe is a synthetic doctype, used for given // permission to add the electronicSafe metadata on files CertifiedElectronicSafe = "io.cozy.certified.electronic_safe" // DirSizes is a synthetic doctype, used for giving the size of a // directory. DirSizes = "io.cozy.files.sizes" // PhotosAlbums doc type for photos albums PhotosAlbums = "io.cozy.photos.albums" // Intents doc type for intents persisted in couchdb Intents = "io.cozy.intents" // Jobs doc type for queued jobs Jobs = "io.cozy.jobs" // JobEvents doc type for real time events sent by jobs JobEvents = "io.cozy.jobs.events" // Support doc type for sending mail to the support Support = "io.cozy.support" // Notifications doc type for notifications Notifications = "io.cozy.notifications" // OAuthAccessCodes doc type for OAuth2 access codes OAuthAccessCodes = "io.cozy.oauth.access_codes" // OAuthClients doc type for OAuth2 clients OAuthClients = "io.cozy.oauth.clients" // Permissions doc type for permissions identifying a connection Permissions = "io.cozy.permissions" // Contacts doc type for sharing Contacts = "io.cozy.contacts" // Groups of contacts doc type for sharing Groups = "io.cozy.contacts.groups" // RemoteRequests doc type for logging requests to remote websites RemoteRequests = "io.cozy.remote.requests" // RemoteSecrets doc type for secrets used by remote doctypes RemoteSecrets = "io.cozy.remote.secrets" // Sessions doc type for sessions identifying a connection Sessions = "io.cozy.sessions" // SessionsLogins doc type for sessions identifying a connection SessionsLogins = "io.cozy.sessions.logins" // Settings doc type for settings to customize an instance Settings = "io.cozy.settings" Shared = "io.cozy.shared" // Sharings doc type for document and file sharing Sharings = "io.cozy.sharings" // SharingsMembers doc type for members of a sharing SharingsMembers = "io.cozy.sharings.members" // SharingsAnswer doc type for credentials exchange for sharings SharingsAnswer = "io.cozy.sharings.answer" // SharingsMoved doc type for when a Cozy is moved to a new address SharingsMoved = "io.cozy.sharings.moved" // SharingsInitialSync doc type for real-time events for initial sync of a // sharing SharingsInitialSync = "io.cozy.sharings.initial_sync" // Triggers doc type for triggers, jobs launchers Triggers = "io.cozy.triggers" // TriggersState doc type for triggers current state, jobs launchers TriggersState = "io.cozy.triggers.state" // Accounts doc type for accounts Accounts = "io.cozy.accounts" // SoftDeletedAccounts doc type for old revisions of deleted accounts SoftDeletedAccounts = "io.cozy.accounts.soft_deleted" // AccountTypes doc type for account types AccountTypes = "io.cozy.account_types" // BitwardenProfiles doc type for Bitwarden profile BitwardenProfiles = "com.bitwarden.profiles" // BitwardenCiphers doc type for Bitwarden ciphers BitwardenCiphers = "com.bitwarden.ciphers" // BitwardenFolders doc type for Bitwarden folders BitwardenFolders = "com.bitwarden.folders" // BitwardenOrganizations doc type for Bitwarden organizations BitwardenOrganizations = "com.bitwarden.organizations" // BitwardenContacts doc type for Bitwarden users that can be added to // an organization BitwardenContacts = "com.bitwarden.contacts" // NotesDocuments doc type is used for manipulating the documents that // represents a note before they are persisted to a file. NotesDocuments = "io.cozy.notes.documents" // NotesSteps doc type is used for patching a note. NotesSteps = "io.cozy.notes.steps" // NotesTelepointers doc type is used for the position of the cursor in a // note. NotesTelepointers = "io.cozy.notes.telepointers" // NotesEvents doc type is used for realtime events related to a note, like // a change of title. NotesEvents = "io.cozy.notes.events" // NotesURL doc type is used to return the URL where a note can be edited. NotesURL = "io.cozy.notes.url" // NotesImages doc type used for images used by a note NotesImages = "io.cozy.notes.images" // OfficeURL doc type is used to return the URL where an office document can be edited. OfficeURL = "io.cozy.office.url" // AuthConfirmations doc type used for realtime events when confirming // authentication. AuthConfirmations = "io.cozy.auth.confirmations" // SourceAccountIdentifier doc type is used to link a directory to the // konnector account that imports documents inside it. SourceAccountIdentifier = "io.cozy.accounts.sourceAccountIdentifier" // NextCloudFiles doc type is used when listing files from a NextCloud via // WebDAV. NextCloudFiles = "io.cozy.remote.nextcloud.files" // ChatConversations doc type is used for a chat between the user and a chatbot. ChatConversations = "io.cozy.ai.chat.conversations" // ChatEvents doc type is used for RAG events about a chat conversation. ChatEvents = "io.cozy.ai.chat.events" )
const ( // DirType is the type attribute for directories DirType = "directory" // FileType is the type attribute for files FileType = "file" )
const ( // RootDirID is the root directory identifier RootDirID = "io.cozy.files.root-dir" // TrashDirID is the trash directory identifier TrashDirID = "io.cozy.files.trash-dir" // will put their folders for the shared files SharedWithMeDirID = "io.cozy.files.shared-with-me-dir" // folders removed from a sharing but still used via a reference are put NoLongerSharedDirID = "io.cozy.files.no-longer-shared-dir" // (shared|external) drives are saved. SharedDrivesDirID = "io.cozy.files.shared-drives-dir" )
const ( // ShortcutMimeType is the mime-type for the .url files. ShortcutMimeType = "application/internet-shortcut" // NoteMimeType is the mime-type for the .cozy-note files. NoteMimeType = "text/vnd.cozy.note+markdown" )
const ( // CarbonCopyKey is the metadata key for a carbon copy (certified) CarbonCopyKey = "carbonCopy" // ElectronicSafeKey is the metadata key for an electronic safe (certified) ElectronicSafeKey = "electronicSafe" // FavoriteKey is the metadata key for a favorite. FavoriteKey = "favorite" )
const ( // NoteImageOriginalFormat is the format for the original image in a note. NoteImageOriginalFormat = "original" // NoteImageThumbFormat is the format for a resized image in a note. NoteImageThumbFormat = "thumb" )
const ( AppAudience = "app" // used by client-side apps KonnectorAudience = "konn" // used by konnectors CLIAudience = "cli" // used by command line interface RegistrationTokenAudience = "registration" // OAuth registration tokens AccessTokenAudience = "access" // OAuth access tokens RefreshTokenAudience = "refresh" // OAuth refresh tokens )
This is the list of possible audience values for JWT.
const Configs = "configs"
Configs doc type assets documents configuration
const DefaultLocale = "en"
DefaultLocale is the default locale when creating an instance and for i18n.
const Instances = "instances"
Instances doc type for User's instance document
const MaxItemsPerPageForMango = 1000
MaxItemsPerPageForMango is the maximal value accepted for the limit parameter used for mango pagination
const ShortCodeLen = 12
ShortCodeLen is the number of chars for the shortcode
const TinyCodeLen = 6
TinyCodeLen is the number of digits for the tinycode
Variables ¶
var ( DefaultValidityDuration = 24 * time.Hour AppTokenValidityDuration = 24 * time.Hour KonnectorTokenValidityDuration = 30 * time.Minute CLITokenValidityDuration = 30 * time.Minute AccessTokenValidityDuration = 7 * 24 * time.Hour )
TokenValidityDuration is the duration where a token is valid in seconds (1 week)
var KnownFlatDomains = []string{
"mycozy.cloud",
"cozy.rocks",
}
KnownFlatDomains is a list of top-domains that can hosts cozy instances with flat sub-domains.
var PlatformApps = []string{
"banks",
"contacts",
"drive",
"home",
"notes",
"passwords",
"photos",
"settings",
"store",
"coachco2",
"mespapiers",
"dataproxy",
}
PlatformApps is the list of applications that can be updated automatically even if their permissions have changed.
var SupportedLocales = []string{"en", "fr"}
SupportedLocales is the list of supported locales tags.
Functions ¶
This section is empty.
Types ¶
type AppType ¶
type AppType int
AppType is an enum to represent the type of application: webapp clientside or konnector serverside.
func NewAppType ¶
NewAppType creates a new AppType from a string