Pass through to provider AuthorizationLookupSession.use_isolated_vault_view
977616
def use_isolated_vault_view(self):
        """"""
        self._vault_view = ISOLATED
        # self._get_provider_session('authorization_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_isolated_vault_view()
            except AttributeError:
                pass
800879
@Override
    public void listScopes(final SecurityContext securityContext, final AsyncResponse asyncResponse) {
        long traceId = LoggerHelpers.traceEnter(log, "listScopes");

        final Principal principal;
        final List<String> authHeader = getAuthorizationHeader();

        try {
            principal = restAuthHelper.authenticate(authHeader);
            restAuthHelper.authorize(authHeader, AuthResourceRepresentation.ofScopes(), principal, READ);
        } catch (AuthException e) {
            log.warn("Get scopes failed due to authentication failure.", e);
            asyncResponse.resume(Response.status(Status.fromStatusCode(e.getResponseCode())).build());
            LoggerHelpers.traceLeave(log, "listScopes", traceId);
            return;
        }

        controllerService.listScopes()
                         .thenApply(scopesList -> {
                             ScopesList scopes = new ScopesList();
                             scopesList.forEach(scope -> {
                                 try {
                                     if (restAuthHelper.isAuthorized(authHeader,
                                             AuthResourceRepresentation.ofScope(scope),
                                             principal, READ)) {
                                         scopes.addScopesItem(new ScopeProperty().scopeName(scope));
                                     }
                                 } catch (AuthException e) {
                                     log.warn(e.getMessage(), e);
                                     // Ignore. This exception occurs under abnormal circumstances and not to determine
                                     // whether the user is authorized. In case it does occur, we assume that the user
                                     // is unauthorized.
                                 }
                             });
                             return Response.status(Status.OK).entity(scopes).build(); })
                         .exceptionally(exception -> {
                             log.warn("listScopes failed with exception: ", exception);
                             return Response.status(Status.INTERNAL_SERVER_ERROR).build(); })
                         .thenApply(response -> {
                             asyncResponse.resume(response);
                             LoggerHelpers.traceLeave(log, "listScopes", traceId);
                             return response;
                         });
    }
124018
def _get_authz_session(self):
        
        from ..utilities import BOOTSTRAP_VAULT_TYPE
        try:
            vaults = self._get_vault_lookup_session().get_vaults_by_genus_type(BOOTSTRAP_VAULT_TYPE)
        except Unimplemented:
            return self._get_authz_manager().get_authorization_session()
        if vaults.available():
            vault = vaults.next()
            return self._get_authz_manager().get_authorization_session_for_vault(vault.get_id())
        else:
            return self._get_authz_manager().get_authorization_session()
590506
function (auth, request, done) {
        var header,
            params = auth.get(AUTH_PARAMETERS),
            url = urlEncoder.toNodeUrl(request.url.toString(true));

        if (!params.username || !params.realm) {
            return done(); // Nothing to do if required parameters are not present.
        }

        request.removeHeader(AUTHORIZATION, {ignoreCase: true});

        params.method = request.method;
        params.uri = url.path;
        params.body = request.body && request.body.toString();

        try {
            header = this.computeHeader(params);
        }
        catch (e) { return done(e); }

        request.addHeader({
            key: AUTHORIZATION,
            value: header,
            system: true
        });

        return done();
    }
399969
def use_isolated_family_view(self):
        """"""
        self._family_view = ISOLATED
        # self._get_provider_session('relationship_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_isolated_family_view()
            except AttributeError:
                pass
910683
function useAccessAuth() {
  return new Promise((resolve, reject) => {
    if (!defaults.accessToken) {
      reject(__generateFakeResponse__(0, '', {}, 'accessToken is missing for Access authentication'))
    }
    else {
      let details = {
        "token_type": "",
        "expires_in": 0,
        "appName": defaults.appName,
        "username": "",
        "role": "",
        "firstName": "",
        "lastName": "",
        "fullName": "",
        "regId": 0,
        "userId": null
      };
      var aToken = defaults.accessToken.toLowerCase().startsWith('bearer') ? defaults.accessToken : 'Bearer ' + defaults.accessToken;
      utils.storage.set('user', {
        token: {
          Authorization:  aToken,
          appName: defaults.appName
        },
        details: details
      });
      resolve(__generateFakeResponse__(200, 'OK', {}, details, {}));
    }
  });

}
1012178
private Observable<ServiceResponse<String>> getPendingCertificateSigningRequestWithServiceResponseAsync(
            String vaultBaseUrl, String certificateName) {
        if (vaultBaseUrl == null) {
            throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null.");
        }
        if (certificateName == null) {
            throw new IllegalArgumentException("Parameter certificateName is required and cannot be null.");
        }
        if (this.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null.");
        }

        String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl);
        KeyVaultClientService clientService = Objects.requireNonNull(service, "Service has not been initialized. Call this.initializeService() before using this method.");

        return clientService
                .getPendingCertificateSigningRequest(certificateName, this.apiVersion(), this.acceptLanguage(),
                        parameterizedHost, this.userAgent())
                .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<String>>>() {
                    @Override
                    public Observable<ServiceResponse<String>> call(Response<ResponseBody> response) {
                        try {
                            ServiceResponse<String> clientResponse = new ServiceResponse<String>(
                                    response.body().string(), response);
                            return Observable.just(clientResponse);
                        } catch (Throwable t) {
                            return Observable.error(t);
                        }
                    }
                });
    }
1025761
public Observable<ServiceResponse<DeletedVaultInner>> getDeletedWithServiceResponseAsync(String vaultName, String location) {
        if (vaultName == null) {
            throw new IllegalArgumentException("Parameter vaultName is required and cannot be null.");
        }
        if (location == null) {
            throw new IllegalArgumentException("Parameter location is required and cannot be null.");
        }
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.getDeleted(vaultName, location, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DeletedVaultInner>>>() {
                @Override
                public Observable<ServiceResponse<DeletedVaultInner>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<DeletedVaultInner> clientResponse = getDeletedDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
815767
def use_comparative_authorization_view(self):
        """"""
        self._object_views['authorization'] = COMPARATIVE
        # self._get_provider_session('authorization_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_comparative_authorization_view()
            except AttributeError:
                pass
477544
def get_vault(self):
        
        if self._lookup_session is None:
            mgr = get_provider_manager('AUTHORIZATION', runtime=self._runtime, proxy=self._proxy)
            self._lookup_session = mgr.get_vault_lookup_session(proxy=getattr(self, "_proxy", None))
        return self._lookup_session.get_vault(Id(self._my_map['id']))
621891
function (auth, request, done) {
        var result,
            params = auth.get([
                'authId',
                'authKey',
                'algorithm',
                'nonce',
                'timestamp',
                'extraData',
                'app',
                'delegation',
                'user'
            ]),
            contentType = request.headers.get('content-type'),

            // force toString to add a protocol to the URL.
            url = urlEncoder.toNodeUrl(request.url.toString(true)),

            self = this;

        if (!params.authId || !params.authKey) {
            return done(); // Nothing to do if required parameters are not present.
        }

        request.removeHeader('Authorization', {ignoreCase: true});

        computeBodyHash(request.body, params.algorithm, 'base64', contentType, function (bodyHash) {
            result = self.computeHeader({
                credentials: {
                    id: params.authId,
                    key: params.authKey,
                    algorithm: params.algorithm
                },
                nonce: params.nonce,
                timestamp: params.timestamp,
                ext: params.extraData,
                app: params.app,
                dlg: params.delegation,
                user: params.user,
                url: url.href, // force toString to add a protocol to the URL.
                method: request.method,
                hash: bodyHash
            });
            request.addHeader({
                key: 'Authorization',
                value: result,
                system: true
            });

            return done();
        });
    }
143306
public void addScope(ApiAppOauthScopeType scope) {
        if (oauth == null) {
            oauth = new ApiAppOauth();
        }
        oauth.addScope(scope);
    }
1096143
def use_federated_vault_view(self):
        """"""
        self._vault_view = FEDERATED
        # self._get_provider_session('authorization_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_federated_vault_view()
            except AttributeError:
                pass
116490
function onAuthorizedAccess() {
          if (angular.isFunction(permission.onAuthorized)) {
            permission.onAuthorized()($element);
          } else {
            var onAuthorizedMethodName = $permission.defaultOnAuthorizedMethod;
            PermPermissionStrategies[onAuthorizedMethodName]($element);
          }
        }
929392
def sync_auth(self, vault_client, resources):
        """"""
        for auth in self.auths():
            auth.sync(vault_client)

        auth_resources = [x for x in resources
                          if isinstance(x, (LDAP, UserPass))]
        for resource in auth_resources:
            resource.sync(vault_client)

        return [x for x in resources
                if not isinstance(x, (LDAP, UserPass, AuditLog))]
535052
def use_plenary_authorization_view(self):
        """"""
        self._object_views['authorization'] = PLENARY
        # self._get_provider_session('authorization_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_plenary_authorization_view()
            except AttributeError:
                pass
1125650
def get_qualifier(self):
        
        # Implemented from template for osid.learning.Activity.get_objective
        if not bool(self._my_map['qualifierId']):
            raise errors.IllegalState('qualifier empty')
        mgr = self._get_provider_manager('AUTHORIZATION')
        if not mgr.supports_qualifier_lookup():
            raise errors.OperationFailed('Authorization does not support Qualifier lookup')
        lookup_session = mgr.get_qualifier_lookup_session(proxy=getattr(self, "_proxy", None))
        lookup_session.use_federated_vault_view()
        return lookup_session.get_qualifier(self.get_qualifier_id())