Gets the AuthorizationLookupSession for the override typed Vault

        Assumes only one
519029
def _get_override_lookup_session(self):
        
        from ..utilities import OVERRIDE_VAULT_TYPE
        try:
            override_vaults = self._get_vault_lookup_session().get_vaults_by_genus_type(OVERRIDE_VAULT_TYPE)
        except Unimplemented:
            return None
        if override_vaults.available():
            vault = override_vaults.next()
        else:
            return None
        session = self._get_authz_manager().get_authorization_lookup_session_for_vault(vault.get_id())
        session.use_isolated_vault_view()
        return session
28837
@Nullable
    private AuthorizationInfo getAuthorizationInfoById(String id) {
        AuthorizationInfo authorizationInfo;

        // Search the cache first
        Cache<String, AuthorizationInfo> idAuthorizationCache = getAvailableIdAuthorizationCache();

        if (idAuthorizationCache != null) {
            authorizationInfo = idAuthorizationCache.get(id);

            if (authorizationInfo != null) {
                // Check whether it is the stand-in "null" cached value
                if (authorizationInfo != _nullAuthorizationInfo) {
                    _log.debug("Authorization info found cached for id {}", id);
                    return authorizationInfo;
                } else {
                    _log.debug("Authorization info previously cached as not found for id {}", id);
                    return null;
                }
            }
        }

        authorizationInfo = getUncachedAuthorizationInfoById(id);
        cacheAuthorizationInfoById(id, authorizationInfo);
        return authorizationInfo;
    }
1099557
private AuthorizationInfo getUncachedAuthorizationInfoFromPrincipals(PrincipalCollection principals) {
        SimpleAuthorizationInfo authInfo = new SimpleAuthorizationInfo();

        for (PrincipalWithRoles principal : getPrincipalsFromPrincipalCollection(principals)) {
            authInfo.addRoles(principal.getRoles());
        }

        return authInfo;
    }
1162936
def get_function(self):
        
        # Implemented from template for osid.learning.Activity.get_objective
        if not bool(self._my_map['functionId']):
            raise errors.IllegalState('function empty')
        mgr = self._get_provider_manager('AUTHORIZATION')
        if not mgr.supports_function_lookup():
            raise errors.OperationFailed('Authorization does not support Function lookup')
        lookup_session = mgr.get_function_lookup_session(proxy=getattr(self, "_proxy", None))
        lookup_session.use_federated_vault_view()
        return lookup_session.get_function(self.get_function_id())
1365615
public ServiceFuture<CertificateBundle> getCertificateAsync(String certificateIdentifier,
            final ServiceCallback<CertificateBundle> serviceCallback) {
        CertificateIdentifier id = new CertificateIdentifier(certificateIdentifier);
        return getCertificateAsync(id.vault(), id.name(), id.version() == null ? "" : id.version(), serviceCallback);
    }
1326188
async def getAuthInfo(self, name):
        '''
        
        '''
        item = self._getAuthItem(name)
        pack = item.pack()

        # translate role guids to names for back compat
        if pack.get('type') == 'user':
            pack['roles'] = [self.cell.auth.role(r).name for r in pack['roles']]

        return (name, pack)
392841
def get_vaults_by_ids(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinLookupSession.get_bins_by_ids
        catalogs = self._get_provider_session('vault_lookup_session').get_vaults_by_ids(*args, **kwargs)
        cat_list = []
        for cat in catalogs:
            cat_list.append(Vault(self._provider_manager, cat, self._runtime, self._proxy))
        return VaultList(cat_list)
56446
def get_parent_vault_nodes(self):
        
        parent_vault_nodes = []
        for node in self._my_map['parentNodes']:
            parent_vault_nodes.append(VaultNode(
                node._my_map,
                runtime=self._runtime,
                proxy=self._proxy,
                lookup_session=self._lookup_session))
        return VaultNodeList(parent_vault_nodes)
91098
private IAuthorizationPrincipal getAuthorizationPrincipal(HttpServletRequest req) {
        IPerson user = personManager.getPerson(req);
        EntityIdentifier ei = user.getEntityIdentifier();
        IAuthorizationPrincipal rslt =
                AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType());
        return rslt;
    }
749390
def sync(self, vault_client, opt):
        """"""
        active_mounts = []
        for audit_log in self.logs():
            audit_log.sync(vault_client)

        # Handle policies only on the first pass. This allows us
        # to ensure that ACL's are in place prior to actually
        # making any changes.
        not_policies = self.sync_policies(vault_client)
        # Handle auth wrapper resources on the next path. The resources
        # may update a path on their own. They may also provide mount
        # tuning information.
        not_auth = self.sync_auth(vault_client, not_policies)
        # Handle mounts only on the next pass. This allows us to
        # ensure that everything is in order prior to actually
        # provisioning secrets. Note we handle removals before
        # anything else, allowing us to address mount conflicts.
        active_mounts, not_mounts = self.sync_mounts(active_mounts,
                                                     not_auth,
                                                     vault_client)
        # Now handle everything else. If "best practices" are being
        # adhered to then every generic mountpoint should exist by now.
        # We handle "child" resources after the first batch
        sorted_resources = sorted(not_mounts, key=childless_first)
        for resource in sorted_resources:
            resource.sync(vault_client)

        for mount in self.mounts():
            if not find_backend(mount.path, active_mounts):
                mount.unmount(vault_client)

        if opt.remove_unknown:
            self.prune(vault_client)
608695
def lookup_token(self):
        """"""
        url = _url_joiner(self._vault_url, 'v1/auth/token/lookup-self')
        resp = requests.get(url, headers=self._headers)
        resp.raise_for_status()
        data = resp.json()
        if data.get('errors'):
            raise VaultException(u'Error looking up Vault token: {}'.format(data['errors']))
        return data
559460
def update_generic_password(client, path):
    """"""
    vault_path, key = path_pieces(path)
    mount = mount_for_path(vault_path, client)
    if not mount:
        client.revoke_self_token()
        raise aomi.exceptions.VaultConstraint('invalid path')

    if backend_type(mount, client) != 'generic':
        client.revoke_self_token()
        raise aomi.exceptions.AomiData("Unsupported backend type")

    LOG.debug("Updating generic password at %s", path)
    existing = client.read(vault_path)
    if not existing or 'data' not in existing:
        LOG.debug("Nothing exists yet at %s!", vault_path)
        existing = {}
    else:
        LOG.debug("Updating %s at %s", key, vault_path)
        existing = existing['data']

    new_password = get_password()
    if key in existing and existing[key] == new_password:
        client.revoke_self_token()
        raise aomi.exceptions.AomiData("Password is same as existing")

    existing[key] = new_password
    client.write(vault_path, **existing)
984968
@Override
    protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {

        AuthorizationInfo authorizationInfo = getUncachedAuthorizationInfoFromPrincipals(principals);

        Cache<String, AuthorizationInfo> idAuthorizationCache = getAvailableIdAuthorizationCache();
        if (idAuthorizationCache != null) {
            // Proactively cache any ID authorization info not already in cache
            for (PrincipalWithRoles principal : getPrincipalsFromPrincipalCollection(principals)) {
                if (idAuthorizationCache.get(principal.getId()) == null) {
                    cacheAuthorizationInfoById(principal.getId(), authorizationInfo);
                }
            }
        }

        return authorizationInfo;
    }
1221914
def vaults(options = {})
      batches = Enumerator.new do |y|
        options = options.merge(account_id: @id)
        resp = @client.list_vaults(options)
        resp.each_page do |page|
          batch = []
          page.data.vault_list.each do |v|
            batch << Vault.new(
              account_id: @id,
              name: v.vault_name,
              data: v,
              client: @client
            )
          end
          y.yield(batch)
        end
      end
      Vault::Collection.new(batches)
    end
706373
function getAuthMod () {
    let authMod = null;
    for (const m of Object.keys(ravelInstance[coreSymbols.modules])) {
      const mod = ravelInstance[coreSymbols.modules][m];
      if (Metadata.getClassMetaValue(Object.getPrototypeOf(mod), '@authconfig', 'enabled', false)) {
        authMod = mod;
        break;
      }
    }
    if (authMod === null) {
      throw new $err.NotFound('Module annotated with @authconfig is required and was not found.');
    }

    return authMod;
  }
383555
def _fetch_app_role_token(vault_url, role_id, secret_id):
        """"""
        url = _url_joiner(vault_url, 'v1/auth/approle/login')
        resp = requests.post(url, data={'role_id': role_id, 'secret_id': secret_id})
        resp.raise_for_status()
        data = resp.json()
        if data.get('errors'):
            raise VaultException(u'Error fetching Vault token: {}'.format(data['errors']))
        return data['auth']['client_token']
413595
def use_plenary_vault_view(self):
        """"""
        self._vault_view = PLENARY
        # self._get_provider_session('authorization_vault_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_plenary_vault_view()
            except AttributeError:
                pass