put inserts an authenticator into the cache. If an authenticator is already associated with the key, the first one is returned instead.
(s string, a *Authenticator)
| 95 | // put inserts an authenticator into the cache. If an authenticator is already |
| 96 | // associated with the key, the first one is returned instead. |
| 97 | func (c *cache) put(s string, a *Authenticator) *Authenticator { |
| 98 | c.mu.Lock() |
| 99 | defer c.mu.Unlock() |
| 100 | existing, ok := c.m[s] |
| 101 | if ok { |
| 102 | return existing |
| 103 | } |
| 104 | c.m[s] = a |
| 105 | return a |
| 106 | } |
| 107 | |
| 108 | // GetAuthenticator returns an exec-based plugin for providing client credentials. |
| 109 | func GetAuthenticator(config *api.ExecConfig) (*Authenticator, error) { |