/** * Creates a new {@code Ini} instance with the specified defaults. * * @param defaults the default sections and/or key-value pairs to copy into the new instance. */ public Ini(Ini defaults) { this(); if (defaults == null) { throw new NullPointerException("Defaults cannot be null."); } for (Section section : defaults.getSections()) { Section copy = new Section(section); this.sections.put(section.getName(), copy); } }
@Inject public KillBillOktaRealm(final SecurityConfig securityConfig) { this.securityConfig = securityConfig; this.httpClient = new AsyncHttpClient(new AsyncHttpClientConfig.Builder().setRequestTimeout(DEFAULT_TIMEOUT_SECS * 1000).build()); if (securityConfig.getShiroOktaPermissionsByGroup() != null) { final Ini ini = new Ini(); // When passing properties on the command line, \n can be escaped ini.load(securityConfig.getShiroOktaPermissionsByGroup().replace("\\n", "\n")); for (final Section section : ini.getSections()) { for (final String role : section.keySet()) { final Collection<String> permissions = ImmutableList.<String>copyOf(SPLITTER.split(section.get(role))); permissionsByGroup.put(role, permissions); } } } }
for (final Section section : ini.getSections()) { for (final String rawRole : section.keySet()) {
/** * Creates a new {@code Ini} instance with the specified defaults. * * @param defaults the default sections and/or key-value pairs to copy into the new instance. */ public Ini(Ini defaults) { this(); if (defaults == null) { throw new NullPointerException("Defaults cannot be null."); } for (Section section : defaults.getSections()) { Section copy = new Section(section); this.sections.put(section.getName(), copy); } }
@Inject public KillBillOktaRealm(final SecurityConfig securityConfig) { this.securityConfig = securityConfig; this.httpClient = new AsyncHttpClient(new AsyncHttpClientConfig.Builder().setRequestTimeout(DEFAULT_TIMEOUT_SECS * 1000).build()); if (securityConfig.getShiroOktaPermissionsByGroup() != null) { final Ini ini = new Ini(); // When passing properties on the command line, \n can be escaped ini.load(securityConfig.getShiroOktaPermissionsByGroup().replace("\\n", "\n")); for (final Section section : ini.getSections()) { for (final String role : section.keySet()) { final Collection<String> permissions = ImmutableList.<String>copyOf(SPLITTER.split(section.get(role))); permissionsByGroup.put(role, permissions); } } } }
for (final Section section : ini.getSections()) { for (final String rawRole : section.keySet()) {
@Override public void init() throws ShiroException { Ini ini = new Ini(); Preconditions.checkNotNull(getConfigLocations()); for(String p : getConfigLocations()) { Ini subIni = new Ini(ini); subIni.loadFromPath(p); // add all values from the sub file to the main configuration for(Section section : subIni.getSections()) { Section existing = ini.getSection(section.getName()); if(existing == null) { existing = ini.addSection(section.getName()); } existing.putAll(section); } } setIni(ini); configure(); }
for (final Section section : ini.getSections()) { for (final String role : section.keySet()) { final Collection<String> permissions = ImmutableList.<String>copyOf(SPLITTER.split(section.get(role)));