Examples of AuthorizationContext


Examples of com.dottydingo.hyperion.service.pipeline.auth.AuthorizationContext

        if(phaseContext.getEffectiveMethod() == HttpMethod.GET)
        {
            response.setCacheMaxAge(plugin.getCacheMaxAge());
        }

        AuthorizationContext authorizationContext = authorizationProvider.authorize(phaseContext);
        phaseContext.setAuthorizationContext(authorizationContext);

        if(!authorizationContext.isAuthorized())
            throw new AuthorizationException("Not Authorized");

    }
View Full Code Here

Examples of com.dottydingo.hyperion.service.pipeline.auth.AuthorizationContext

        ObjectWrapper<P> persistentObjectWrapper = createPersistentObjectWrapper(persistentObject,context);
        ObjectWrapper<C> clientObjectWrapper = createClientObjectWrapper(client,context);

        beforeConvert(clientObjectWrapper,persistentObjectWrapper,context);

        AuthorizationContext authorizationContext = context.getAuthorizationContext();
        for (FieldMapper mapper : fieldMapperMap.values())
        {
            if(authorizationContext.isWritable(mapper.getClientFieldName()))
                mapper.convertToPersistent(clientObjectWrapper,persistentObjectWrapper,context);
        }

        afterConvert(clientObjectWrapper,persistentObjectWrapper,context);
View Full Code Here

Examples of com.dottydingo.hyperion.service.pipeline.auth.AuthorizationContext

        ObjectWrapper<P> persistentObjectWrapper = createPersistentObjectWrapper(persistent,context);
        ObjectWrapper<C> clientObjectWrapper = createClientObjectWrapper(client,context);

        beforeCopy(clientObjectWrapper,persistentObjectWrapper,context);

        AuthorizationContext authorizationContext = context.getAuthorizationContext();
        for (FieldMapper mapper : fieldMapperMap.values())
        {
            if(authorizationContext.isWritable(mapper.getClientFieldName())
                    && mapper.convertToPersistent(clientObjectWrapper,persistentObjectWrapper,context))
            {
                dirty = true;
                context.addChangedField(mapper.getClientFieldName());
            }
View Full Code Here

Examples of com.dottydingo.hyperion.service.pipeline.auth.AuthorizationContext

        ObjectWrapper<P> persistentObjectWrapper = createPersistentObjectWrapper(persistent,context);
        ObjectWrapper<C> clientObjectWrapper = createClientObjectWrapper(clientObject,context);

        Set<String> requestedFields = context.getRequestedFields();
        AuthorizationContext authorizationContext = context.getAuthorizationContext();

        for (Map.Entry<String, FieldMapper> entry : fieldMapperMap.entrySet())
        {
            if((requestedFields == null || requestedFields.contains(entry.getKey()))
                    && authorizationContext.isReadable(entry.getKey()))
            {

                entry.getValue().convertToClient(persistentObjectWrapper,clientObjectWrapper,context);
            }
        }
View Full Code Here

Examples of com.dottydingo.hyperion.service.pipeline.auth.AuthorizationContext

        if(phaseContext.getEffectiveMethod() == HttpMethod.GET)
        {
            response.setCacheMaxAge(plugin.getCacheMaxAge());
        }

        AuthorizationContext authorizationContext = authorizationProvider.authorize(phaseContext);
        phaseContext.setAuthorizationContext(authorizationContext);

        if(!authorizationContext.isAuthorized())
            throw new HyperionException(403,"Not Authorized");

    }
View Full Code Here

Examples of com.mangofactory.swagger.authorization.AuthorizationContext

public class OperationAuthReader implements RequestMappingReader {

  @Override
  public void execute(RequestMappingContext context) {
    AuthorizationContext authorizationContext = (AuthorizationContext) context.get("authorizationContext");

    HandlerMethod handlerMethod = context.getHandlerMethod();
    String requestMappingPattern = (String) context.get("requestMappingPattern");
    List<com.wordnik.swagger.model.Authorization> authorizations = newArrayList();

    if (null != authorizationContext) {
      authorizations = authorizationContext.getAuthorizationsForPath(requestMappingPattern);
    }

    ApiOperation apiOperationAnnotation = handlerMethod.getMethodAnnotation(ApiOperation.class);

    if (null != apiOperationAnnotation && null != apiOperationAnnotation.authorizations()) {
View Full Code Here

Examples of com.mangofactory.swagger.authorization.AuthorizationContext

  public void execute(RequestMappingContext outerContext) {

    RequestMappingInfo requestMappingInfo = outerContext.getRequestMappingInfo();
    HandlerMethod handlerMethod = outerContext.getHandlerMethod();
    SwaggerGlobalSettings swaggerGlobalSettings = (SwaggerGlobalSettings) outerContext.get("swaggerGlobalSettings");
    AuthorizationContext authorizationContext = (AuthorizationContext) outerContext.get("authorizationContext");
    String requestMappingPattern = (String) outerContext.get("requestMappingPattern");
    RequestMethodsRequestCondition requestMethodsRequestCondition = requestMappingInfo.getMethodsCondition();
    List<Operation> operations = newArrayList();

    Set<RequestMethod> requestMethods = requestMethodsRequestCondition.getMethods();
View Full Code Here

Examples of com.ngdata.lily.security.hbase.client.AuthorizationContext

            Set<String> roles = new HashSet<String>();
            Splitter splitter = Splitter.on(",").trimResults().omitEmptyStrings();
            for (String role : splitter.split(cmd.getOptionValue(rolesOption.getLongOpt()))) {
                roles.add(role);
            }
            AuthorizationContextHolder.setCurrentContext(new AuthorizationContext("lily-import", repositoryName, roles));
        }

        lilyClient = new LilyClient(zkConnectionString, zkSessionTimeout);

        for (String arg : (List<String>)cmd.getArgList()) {
View Full Code Here

Examples of com.ngdata.lily.security.hbase.client.AuthorizationContext

        table.read(record.getId());
        assertEquals("jef", AuthzRegionObserver.lastSeenAuthzCtx.getName());
    }

    private void setUser(String name, Set<String> roles) {
        AuthorizationContext authzContext = new AuthorizationContext(name, "default", roles);
        AuthorizationContextHolder.setCurrentContext(authzContext);
    }
View Full Code Here

Examples of com.ngdata.lily.security.hbase.client.AuthorizationContext

        Set<String> roles = new HashSet<String>();
        for (String role : authzContext.getRoles()) {
            roles.add(role);
        }

        return new AuthorizationContext(authzContext.getName(), authzContext.getTenant(), roles);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.