コード例 #1
0
 @Override
 protected void callback(ArtifactoryServer server, UnmarshallingContext context) {
   if (StringUtils.isNotBlank(server.userName) && (server.resolverCredentials == null)) {
     server.resolverCredentials =
         new Credentials(server.userName, Scrambler.descramble(server.password));
   }
 }
コード例 #2
0
 @Override protected void callback(Details d, UnmarshallingContext context) {
     // Convert to hashed password and report to monitor if we load old data
     if (d.password!=null && d.passwordHash==null) {
         d.passwordHash = PASSWORD_ENCODER.encodePassword(Scrambler.descramble(d.password),null);
         OldDataMonitor.report(context, "1.283");
     }
 }
コード例 #3
0
  @DataBoundConstructor
  public ReverseProxySecurityRealm(
      String forwardedUser,
      String headerGroups,
      String headerGroupsDelimiter,
      String server,
      String rootDN,
      boolean inhibitInferRootDN,
      String userSearchBase,
      String userSearch,
      String groupSearchBase,
      String groupSearchFilter,
      String groupMembershipFilter,
      String managerDN,
      String managerPassword,
      Integer updateInterval) {

    this.forwardedUser = fixEmptyAndTrim(forwardedUser);

    this.headerGroups = headerGroups;
    if (!StringUtils.isBlank(headerGroupsDelimiter)) {
      this.headerGroupsDelimiter = headerGroupsDelimiter.trim();
    } else {
      this.headerGroupsDelimiter = "|";
    }
    //
    this.server = fixEmptyAndTrim(server);
    this.managerDN = fixEmpty(managerDN);
    this.managerPassword = Scrambler.scramble(fixEmpty(managerPassword));
    this.inhibitInferRootDN = inhibitInferRootDN;

    if (this.server != null) {
      if (!inhibitInferRootDN && fixEmptyAndTrim(rootDN) == null)
        rootDN = fixNull(inferRootDN(server));
      this.rootDN = rootDN.trim();
    } else {
      this.rootDN = null;
    }

    this.userSearchBase = fixNull(userSearchBase).trim();
    userSearch = fixEmptyAndTrim(userSearch);
    this.userSearch = userSearch != null ? userSearch : "uid={0}";
    this.groupSearchBase = fixEmptyAndTrim(groupSearchBase);
    this.groupSearchFilter = fixEmptyAndTrim(groupSearchFilter);
    this.groupMembershipFilter = fixEmptyAndTrim(groupMembershipFilter);

    this.updateInterval =
        (updateInterval == null || updateInterval <= 0) ? CHECK_INTERVAL : updateInterval;

    authorities = new GrantedAuthority[0];
    authContext = new Hashtable<String, GrantedAuthority[]>();
    authorityUpdateCache = new Hashtable<String, Long>();
  }
コード例 #4
0
 public String getManagerPassword() {
   return Scrambler.descramble(managerPassword);
 }