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