org.apereo.inspektr.audit.annotation.Audit.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(12.0k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中org.apereo.inspektr.audit.annotation.Audit.<init>()方法的一些代码示例,展示了Audit.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Audit.<init>()方法的具体详情如下:
包路径:org.apereo.inspektr.audit.annotation.Audit
类名称:Audit
方法名:<init>

Audit.<init>介绍

暂无

代码示例

代码示例来源:origin: org.apereo.cas/cas-server-core-services-registry

@Audit(action = "SAVE_SERVICE",
  actionResolverName = "SAVE_SERVICE_ACTION_RESOLVER",
  resourceResolverName = "SAVE_SERVICE_RESOURCE_RESOLVER")
@Override
public RegisteredService save(final RegisteredService registeredService) {
  return save(registeredService, true);
}

代码示例来源:origin: org.apereo.cas/cas-server-support-surrogate-authentication

@Override
  @Audit(action = "SURROGATE_AUTHENTICATION_ELIGIBILITY_VERIFICATION",
    actionResolverName = "SURROGATE_AUTHENTICATION_ELIGIBILITY_VERIFICATION_ACTION_RESOLVER",
    resourceResolverName = "SURROGATE_AUTHENTICATION_ELIGIBILITY_VERIFICATION_RESOURCE_RESOLVER")
  public AuditableExecutionResult execute(final AuditableContext context) {
    return super.execute(context);
  }
}

代码示例来源:origin: org.apereo.cas/cas-server-core-webflow-mfa-api

@Audit(action = "AUTHENTICATION_EVENT",
    actionResolverName = "AUTHENTICATION_EVENT_ACTION_RESOLVER",
    resourceResolverName = "AUTHENTICATION_EVENT_RESOURCE_RESOLVER")
  @Override
  public Event resolveSingle(final RequestContext context) {
    return super.resolveSingle(context);
  }
}

代码示例来源:origin: org.apereo.cas/cas-server-support-duo-core

@Audit(action = "AUTHENTICATION_EVENT",
    actionResolverName = "AUTHENTICATION_EVENT_ACTION_RESOLVER",
    resourceResolverName = "AUTHENTICATION_EVENT_RESOURCE_RESOLVER")
  @Override
  public Event resolveSingle(final RequestContext context) {
    return super.resolveSingle(context);
  }
}

代码示例来源:origin: org.apereo.cas/cas-server-core-webflow-mfa-api

@Audit(action = "AUTHENTICATION_EVENT",
  actionResolverName = "AUTHENTICATION_EVENT_ACTION_RESOLVER",
  resourceResolverName = "AUTHENTICATION_EVENT_RESOURCE_RESOLVER")
@Override
public Event resolveSingle(final RequestContext context) {
  return super.resolveSingle(context);
}

代码示例来源:origin: org.apereo.cas/cas-server-support-otp-mfa-core

@Audit(action = "AUTHENTICATION_EVENT",
    actionResolverName = "AUTHENTICATION_EVENT_ACTION_RESOLVER",
    resourceResolverName = "AUTHENTICATION_EVENT_RESOURCE_RESOLVER")
  @Override
  public Event resolveSingle(final RequestContext context) {
    return super.resolveSingle(context);
  }
}

代码示例来源:origin: org.apereo.cas/cas-server-support-pm

@Audit(action = "CHANGE_PASSWORD",
  actionResolverName = "CHANGE_PASSWORD_ACTION_RESOLVER",
  resourceResolverName = "CHANGE_PASSWORD_RESOURCE_RESOLVER")
@Override
public boolean change(final Credential c, final PasswordChangeBean bean) throws InvalidPasswordException {
  return changeInternal(c, bean);
}

代码示例来源:origin: org.apereo.cas/cas-server-support-yubikey-core

@Audit(action = "AUTHENTICATION_EVENT",
    actionResolverName = "AUTHENTICATION_EVENT_ACTION_RESOLVER",
    resourceResolverName = "AUTHENTICATION_EVENT_RESOURCE_RESOLVER")
  @Override
  public Event resolveSingle(final RequestContext context) {
    return super.resolveSingle(context);
  }
}

代码示例来源:origin: org.apereo.cas/cas-server-core-rest

@Audit(
  action = "REST_API_SERVICE_TICKET",
  actionResolverName = "REST_API_SERVICE_TICKET_ACTION_RESOLVER",
  resourceResolverName = "REST_API_SERVICE_TICKET_RESOURCE_RESOLVER")
@Override
public ResponseEntity<String> build(final String ticketGrantingTicket, final Service service, final AuthenticationResult authenticationResult) {
  val factory = chain.stream()
    .filter(f -> f.supports(service, authenticationResult))
    .findFirst()
    .orElseThrow(() -> new IllegalArgumentException("Unable to locate a response entity factory to build a service ticket. "
      + "This generally is due to a configuration issue where CAS is unable to recognize the incoming request"));
  return factory.build(ticketGrantingTicket, service, authenticationResult);
}

代码示例来源:origin: org.apereo.cas/cas-server-core-rest

@Audit(
  action = "REST_API_TICKET_GRANTING_TICKET",
  actionResolverName = "REST_API_TICKET_GRANTING_TICKET_ACTION_RESOLVER",
  resourceResolverName = "REST_API_TICKET_GRANTING_TICKET_RESOURCE_RESOLVER")
@Override
public ResponseEntity<String> build(final TicketGrantingTicket ticketGrantingTicket, final HttpServletRequest request) throws Exception {
  val ticketReference = new URI(request.getRequestURL().toString() + '/' + ticketGrantingTicket.getId());
  val headers = new HttpHeaders();
  headers.setLocation(ticketReference);
  val response = getResponse(ticketGrantingTicket, request, ticketReference, headers);
  val entity = new ResponseEntity<String>(response, headers, HttpStatus.CREATED);
  LOGGER.debug("Created response entity [{}]", entity);
  return entity;
}

代码示例来源:origin: org.apereo.cas/cas-server-core-services-registry

@Audit(action = "DELETE_SERVICE",
  actionResolverName = "DELETE_SERVICE_ACTION_RESOLVER",
  resourceResolverName = "DELETE_SERVICE_RESOURCE_RESOLVER")
@Override
public synchronized RegisteredService delete(final long id) {
  val service = findServiceBy(id);
  return delete(service);
}

代码示例来源:origin: org.apereo.cas/cas-server-support-trusted-mfa

@Audit(action = "TRUSTED_AUTHENTICATION",
  actionResolverName = "TRUSTED_AUTHENTICATION_ACTION_RESOLVER",
  resourceResolverName = "TRUSTED_AUTHENTICATION_RESOURCE_RESOLVER")
@Override
public MultifactorAuthenticationTrustRecord set(final MultifactorAuthenticationTrustRecord record) {
  LOGGER.debug("Stored authentication trust record for [{}]", record);
  record.setRecordKey(generateKey(record));
  return setInternal(record);
}

代码示例来源:origin: org.apereo.cas/cas-server-support-oauth

@Audit(action = "OAUTH2_ACCESS_TOKEN_RESPONSE",
  actionResolverName = "OAUTH2_ACCESS_TOKEN_RESPONSE_ACTION_RESOLVER",
  resourceResolverName = "OAUTH2_ACCESS_TOKEN_RESPONSE_RESOURCE_RESOLVER")
@Override
@SneakyThrows
public ModelAndView generate(final HttpServletRequest request, final HttpServletResponse response,
               final OAuth20AccessTokenResponseResult result) {
  if (shouldGenerateDeviceFlowResponse(result)) {
    return generateResponseForDeviceToken(request, response, result);
  }
  return generateResponseForAccessToken(request, response, result);
}

代码示例来源:origin: org.apereo.cas/cas-server-support-oauth

@Audit(action = "OAUTH2_ACCESS_TOKEN_REQUEST",
    actionResolverName = "OAUTH2_ACCESS_TOKEN_REQUEST_ACTION_RESOLVER",
    resourceResolverName = "OAUTH2_ACCESS_TOKEN_REQUEST_RESOURCE_RESOLVER")
  @Override
  public AuditableExecutionResult execute(final AuditableContext context) {
    val request = (HttpServletRequest) context.getRequest().get();
    val response = (HttpServletResponse) context.getResponse().get();

    val result = this.accessTokenGrantRequestExtractors.stream()
      .filter(ext -> ext.supports(request))
      .findFirst()
      .orElseThrow((Supplier<RuntimeException>) () -> new UnsupportedOperationException("Access token request is not supported"))
      .extract(request, response);

    return AuditableExecutionResult.builder().executionResult(result).build();
  }
}

代码示例来源:origin: org.apereo.cas/cas-server-support-oauth

@Override
@Audit(action = "OAUTH2_USER_PROFILE_DATA",
  actionResolverName = "OAUTH2_USER_PROFILE_DATA_ACTION_RESOLVER",
  resourceResolverName = "OAUTH2_USER_PROFILE_DATA_RESOURCE_RESOLVER")
public Map<String, Object> createFrom(final AccessToken accessToken, final J2EContext context) {
  val service = accessToken.getService();
  val registeredService = this.servicesManager.findServiceBy(service);
  val principal = getAccessTokenAuthenticationPrincipal(accessToken, context, registeredService);
  val map = new HashMap<String, Object>();
  map.put(OAuth20UserProfileViewRenderer.MODEL_ATTRIBUTE_ID, principal.getId());
  val attributes = principal.getAttributes();
  map.put(OAuth20UserProfileViewRenderer.MODEL_ATTRIBUTE_ATTRIBUTES, attributes);
  finalizeProfileResponse(accessToken, map, principal);
  return map;
}

代码示例来源:origin: org.apereo.cas/cas-server-support-saml-idp-web

@Audit(
  action = "SAML2_RESPONSE",
  actionResolverName = "SAML2_RESPONSE_ACTION_RESOLVER",
  resourceResolverName = "SAML2_RESPONSE_RESOURCE_RESOLVER")
@Override
public T build(final RequestAbstractType authnRequest,
        final HttpServletRequest request,
        final HttpServletResponse response,
        final Object casAssertion,
        final SamlRegisteredService service,
        final SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
        final String binding,
        final MessageContext messageContext) throws SamlException {
  val assertion = buildSamlAssertion(authnRequest, request, response,
    casAssertion, service, adaptor, binding, messageContext);
  val finalResponse = buildResponse(assertion, casAssertion, authnRequest,
    service, adaptor, request, response, binding, messageContext);
  return encodeFinalResponse(request, response, service, adaptor, finalResponse, binding, authnRequest, casAssertion);
}

代码示例来源:origin: org.apereo.cas/cas-server-support-pac4j-core

@Audit(action = "DELEGATED_CLIENT",
    actionResolverName = "DELEGATED_CLIENT_ACTION_RESOLVER",
    resourceResolverName = "DELEGATED_CLIENT_RESOURCE_RESOLVER")
  @Override
  public AuditableExecutionResult execute(final AuditableContext context) {
    val result = AuditableExecutionResult.of(context);

    if (context.getRegisteredService().isPresent() && context.getProperties().containsKey(Client.class.getSimpleName())) {
      val registeredService = context.getRegisteredService().get();
      val clientName = context.getProperties().get(Client.class.getSimpleName()).toString();
      val policy = registeredService.getAccessStrategy().getDelegatedAuthenticationPolicy();
      if (policy != null) {
        if (!policy.isProviderAllowed(clientName, registeredService)) {
          LOGGER.debug("Delegated authentication policy for [{}] does not allow for using client [{}]", registeredService,
            clientName);
          val e = new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE, StringUtils.EMPTY);
          result.setException(e);
        }
      }
    }
    return result;
  }
}

代码示例来源:origin: org.apereo.cas/cas-server-core

@Audit(
  action = "TICKET_GRANTING_TICKET_DESTROYED",
  actionResolverName = "DESTROY_TICKET_GRANTING_TICKET_RESOLVER",
  resourceResolverName = "DESTROY_TICKET_GRANTING_TICKET_RESOURCE_RESOLVER")
@Override
public List<SingleLogoutRequest> destroyTicketGrantingTicket(final String ticketGrantingTicketId) {
  try {
    LOGGER.debug("Removing ticket [{}] from registry...", ticketGrantingTicketId);
    val ticket = getTicket(ticketGrantingTicketId, TicketGrantingTicket.class);
    LOGGER.debug("Ticket [{}] found. Processing logout requests and then deleting the ticket...", ticket.getId());
    AuthenticationCredentialsThreadLocalBinder.bindCurrent(ticket.getAuthentication());
    val logoutRequests = this.logoutManager.performLogout(ticket);
    deleteTicket(ticketGrantingTicketId);
    doPublishEvent(new CasTicketGrantingTicketDestroyedEvent(this, ticket));
    return logoutRequests;
  } catch (final InvalidTicketException e) {
    LOGGER.debug("Ticket-granting ticket [{}] cannot be found in the ticket registry.", ticketGrantingTicketId);
  }
  return new ArrayList<>(0);
}

代码示例来源:origin: org.apereo.cas/cas-server-core-services-registry

@Audit(action = "DELETE_SERVICE",
  actionResolverName = "DELETE_SERVICE_ACTION_RESOLVER",
  resourceResolverName = "DELETE_SERVICE_RESOURCE_RESOLVER")
@Override
public synchronized RegisteredService delete(final RegisteredService service) {
  if (service != null) {
    publishEvent(new CasRegisteredServicePreDeleteEvent(this, service));
    this.serviceRegistry.delete(service);
    this.services.remove(service.getId());
    deleteInternal(service);
    publishEvent(new CasRegisteredServiceDeletedEvent(this, service));
  }
  return service;
}

代码示例来源:origin: org.apereo.cas/cas-server-core-services-registry

@Audit(action = "SAVE_SERVICE",
  actionResolverName = "SAVE_SERVICE_ACTION_RESOLVER",
  resourceResolverName = "SAVE_SERVICE_RESOURCE_RESOLVER")
@Override
public synchronized RegisteredService save(final RegisteredService registeredService, final boolean publishEvent) {
  publishEvent(new CasRegisteredServicePreSaveEvent(this, registeredService));
  val r = this.serviceRegistry.save(registeredService);
  this.services.put(r.getId(), r);
  saveInternal(registeredService);
  if (publishEvent) {
    publishEvent(new CasRegisteredServiceSavedEvent(this, r));
  }
  return r;
}

相关文章

Audit类方法