github.com/ali-iotechsys/cli@v20.10.0+incompatible/cli/context/store/doc.go (about)

     1  // Package store provides a generic way to store credentials to connect to virtually any kind of remote system.
     2  // The term `context` comes from the similar feature in Kubernetes kubectl config files.
     3  //
     4  // Conceptually, a context is a set of metadata and TLS data, that can be used to connect to various endpoints
     5  // of a remote system. TLS data and metadata are stored separately, so that in the future, we will be able to store sensitive
     6  // information in a more secure way, depending on the os we are running on (e.g.: on Windows we could use the user Certificate Store, on Mac OS the user Keychain...).
     7  //
     8  // Current implementation is purely file based with the following structure:
     9  // ${CONTEXT_ROOT}
    10  //   - meta/
    11  //     - <context id>/meta.json: contains context medata (key/value pairs) as well as a list of endpoints (themselves containing key/value pair metadata)
    12  //   - tls/
    13  //     - <context id>/endpoint1/: directory containing TLS data for the endpoint1 in the corresponding context
    14  //
    15  // The context store itself has absolutely no knowledge about what a docker or a kubernetes endpoint should contain in term of metadata or TLS config.
    16  // Client code is responsible for generating and parsing endpoint metadata and TLS files.
    17  // The multi-endpoints approach of this package allows to combine many different endpoints in the same "context" (e.g., the Docker CLI
    18  // is able for a single context to define both a docker endpoint and a Kubernetes endpoint for the same cluster, and also specify which
    19  // orchestrator to use by default when deploying a compose stack on this cluster).
    20  //
    21  // Context IDs are actually SHA256 hashes of the context name, and are there only to avoid dealing with special characters in context names.
    22  package store