// Secret is used to look up the secret with the given type.
977620
func (b *Backend) Secret(k string) *Secret {
	for _, s := range b.Secrets {
		if s.Type == k {
			return s
		}
	}

	return nil
}
89024
func (s *Secret) Equal(other store.Secret) bool {
	if s == nil && (other == nil || reflect.ValueOf(other).IsNil()) {
		return true
	}
	if s == nil || other == nil || reflect.ValueOf(other).IsNil() {
		return false
	}

	s.Lock()
	defer s.Unlock()

	if s.password != other.Password() {
		return false
	}

	if s.body != other.Body() {
		return false
	}

	return true
}
553788
func (c *Core) SecretProgress() (int, string) {
	c.stateLock.RLock()
	defer c.stateLock.RUnlock()
	switch c.unlockInfo {
	case nil:
		return 0, ""
	default:
		return len(c.unlockInfo.Parts), c.unlockInfo.Nonce
	}
}
586200
func (s secretNamespaceLister) List(selector labels.Selector) (ret []*v1.Secret, err error) {
	err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
		ret = append(ret, m.(*v1.Secret))
	})
	return ret, err
}
42990
func (c *client) Secret(owner, name, secret string) (*Secret, error) {
	out := new(Secret)
	uri := fmt.Sprintf(pathRepoSecret, c.addr, owner, name, secret)
	err := c.get(uri, out)
	return out, err
}
25854
func Convert_core_Secret_To_v1_Secret(in *core.Secret, out *v1.Secret, s conversion.Scope) error {
	return autoConvert_core_Secret_To_v1_Secret(in, out, s)
}
695541
func Secrets(namespace Namespace, secrets map[string]composetypes.SecretConfig) ([]swarm.SecretSpec, error) {
	result := []swarm.SecretSpec{}
	for name, secret := range secrets {
		if secret.External.External {
			continue
		}

		var obj swarmFileObject
		var err error
		if secret.Driver != "" {
			obj, err = driverObjectConfig(namespace, name, composetypes.FileObjectConfig(secret))
		} else {
			obj, err = fileObjectConfig(namespace, name, composetypes.FileObjectConfig(secret))
		}
		if err != nil {
			return nil, err
		}
		spec := swarm.SecretSpec{Annotations: obj.Annotations, Data: obj.Data}
		if secret.Driver != "" {
			spec.Driver = &swarm.Driver{
				Name:    secret.Driver,
				Options: secret.DriverOpts,
			}
		}
		if secret.TemplateDriver != "" {
			spec.Templating = &swarm.Driver{
				Name: secret.TemplateDriver,
			}
		}
		result = append(result, spec)
	}
	return result, nil
}
1266837
func Secret() (c *SecretController) {
	return &SecretController{
		List:   secretList,
		Delete: secretDelete,
		New:    secretNew,
		Create: secretCreate,
		Edit:   secretEdit,
		Update: secretUpdate,
	}
}
307157
func (sk *SecretKey) Decrypt(in []byte) ([]byte, error) {
	return sk.Key.Decrypt(in)
}
1075135
func (_class SecretClass) Create(sessionID SessionRef, args SecretRecord) (_retval SecretRef, _err error) {
	_method := "secret.create"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_argsArg, _err := convertSecretRecordToXen(fmt.Sprintf("%s(%s)", _method, "args"), args)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _argsArg)
	if _err != nil {
		return
	}
	_retval, _err = convertSecretRefToGo(_method + " -> ", _result.Value)
	return
}
751060
func (s *secrets) Get(secretID string) (*api.Secret, error) {
	s.mu.RLock()
	defer s.mu.RUnlock()
	if s, ok := s.m[secretID]; ok {
		return s, nil
	}
	return nil, fmt.Errorf("secret %s not found", secretID)
}
30860
func (item *Item) GetSecret(session *Session) (*Secret, error) {
  secret := Secret{}

  err := item.dbus.Call("org.freedesktop.Secret.Item.GetSecret", 0, session.Path()).Store(&secret)
  if err != nil {
    return &Secret{}, err
  }

  return &secret, nil
}
769516
func secretBytes(secret string) []byte {
	b, err := base64.URLEncoding.DecodeString(addPadding(secret))
	if err == nil {
		return []byte(addPadding(string(b)))
	}
	return []byte(secret)
}
727229
func New(password, body string) *Secret {
	return &Secret{
		password: password,
		body:     body,
	}
}
384360
func (s StaticStore) GetSecret(k Key) (Secret, error) {
	if secret, ok := s[k]; ok {
		return secret.Clone(), nil
	}
	return Secret{}, ErrNoSuchSecret
}
293162
func (c *ClientsetSecretStore) Secret(name string) (*fi.Secret, error) {
	s, err := c.FindSecret(name)
	if err != nil {
		return nil, err
	}
	if s == nil {
		return nil, fmt.Errorf("Secret not found: %q", name)
	}
	return s, nil
}
507295
func (c *FakeImageStreams) Secrets(imageStreamName string, options v1.GetOptions) (result *corev1.SecretList, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewGetSubresourceAction(imagestreamsResource, c.ns, "secrets", imageStreamName), &corev1.SecretList{})

	if obj == nil {
		return nil, err
	}
	return obj.(*corev1.SecretList), err
}