private void clear( SiteConfig loc, PasswordType type ) { loc.removeAttribute( PASSWORD_PREFIX + type.name() ); }
private void set( SiteConfig loc, PasswordType type, String password ) { loc.setAttribute( PASSWORD_PREFIX + type.name(), password ); }
@Override public String lookup( final PasswordKey id ) { SiteConfig config = lookupManager.lookup( id.getSiteId() ); if ( config == null ) { return null; } return config.getAttribute( PASSWORD_PREFIX + id.getPasswordType().name(), String.class ); }
@Override public String lookup( PasswordKey id ) { Location location = locationLookup.lookup( id.getSiteId() ); return location == null ? null : delegate.getPassword( new PasswordEntry( location, id.getPasswordType().name() ) ); } }
@Override public String lookup( PasswordKey id ) { Location location = locationLookup.lookup( id.getSiteId() ); return location == null ? null : delegate.getPassword( new PasswordEntry( location, id.getPasswordType().name() ) ); } }
private SiteConfig toSiteConfig( RemoteRepository repository ) { SiteConfigBuilder builder = new SiteConfigBuilder( repository.getName(), repository.getUrl() ); logger.debug( "Adding server PEM to site config for: {}\n{}", repository.getKey(), repository.getServerCertPem() ); builder.withKeyCertPem( repository.getKeyCertPem() ) .withProxyHost( repository.getProxyHost() ) .withProxyPort( repository.getProxyPort() ) .withProxyUser( repository.getProxyUser() ) .withRequestTimeoutSeconds( repository.getTimeoutSeconds() ) .withServerCertPem( repository.getServerCertPem() ) .withTrustType( SiteTrustType.TRUST_SELF_SIGNED ) .withUser( repository.getUser() ); SiteConfig config = builder.build(); logger.debug( "Got server PEM in site config:\n{}", config.getServerCertPem() ); config.setAttribute( PASSWORD_PREFIX + KEY.name(), repository.getKeyPassword() ); config.setAttribute( PASSWORD_PREFIX + USER.name(), repository.getPassword() ); config.setAttribute( PASSWORD_PREFIX + PROXY.name(), repository.getProxyPassword() ); return config; }