Пример #1
0
  protected void checkMembershipValidity(RequestContext context) {

    VOMSUser u = context.getVOMSUser();
    VOMSRequest r = context.getRequest();

    if (u.isSuspended()) {
      failResponse(
          context,
          VOMSErrorMessage.suspendedUser(
              r.getHolderSubject(), r.getHolderIssuer(), u.getSuspensionReason()));
      context.setHandled(true);
      return;
    }

    Certificate cert = u.getCertificate(r.getHolderSubject(), r.getHolderIssuer());

    if (cert.isSuspended()) {
      failResponse(
          context,
          VOMSErrorMessage.suspendedCertificate(
              cert.getSubjectString(),
              cert.getCa().getSubjectString(),
              cert.getSuspensionReason()));
    }
  }
Пример #2
0
  private void resolveUser(RequestContext context) {

    VOMSRequest request = context.getRequest();
    VOMSUser user = null;

    user = VOMSUserDAO.instance().lookup(request.getHolderSubject(), request.getHolderIssuer());

    if (user == null) {

      VOMSErrorMessage m =
          VOMSErrorMessage.noSuchUser(request.getHolderSubject(), request.getHolderIssuer());

      context.getResponse().setOutcome(Outcome.FAILURE);
      context.getResponse().getErrorMessages().add(m);
      context.setHandled(true);

    } else {
      context.setVOMSUser(user);
    }
  }