@Test void groupRemoveMembersThrowsOnUnmanagedGroup() { assertThrows(FreeIpaClientException.class, () -> underTest.groupAddMembers(FreeIpaChecks.IPA_UNMANAGED_GROUPS.get(0), List.of("harry", "sally")) ); }
public RPCResponse<Group> groupAddMembers(String group, Collection<String> users) throws FreeIpaClientException { FreeIpaChecks.checkGroupNotUnmanaged(group, () -> String.format("Group '%s' is not managed and membership cannot be changed", group)); List<Object> flags = List.of(group); Map<String, Object> params = Map.of( "user", users ); return invoke("group_add_member", flags, params, Group.class); }
FreeIpaClient { public RPCResponse<Group> groupAddMembers(String group, Collection<String> users) throws FreeIpaClientException { FreeIpaChecks.checkGroupNotUnmanaged(group, () -> String.format("Group '%s' is not managed and membership cannot be changed", group)); List<Object> flags = List.of(group); Map<String, Object> params = Map.of( "user", users ); return invoke("group_add_member", flags, params, Group.class); } }
FreeIpaClient { public RPCResponse<Group> groupAddMembers(String group, Collection<String> users) throws FreeIpaClientException { FreeIpaChecks.checkGroupNotUnmanaged(group, () -> String.format("Group '%s' is not managed and membership cannot be changed", group)); List<Object> flags = List.of(group); Map<String, Object> params = Map.of( "user", users ); return invoke("group_add_member", flags, params, Group.class); } FreeIpaClient(JsonRpcHttpClient jsonRpcHttpClient, String apiAddress, String hostname);  FreeIpaClient(JsonRpcHttpClient jsonRpcHttpClient, String apiVersion, String apiAddress, String hostname); }
FreeIpaClient { public RPCResponse<Group> groupAddMembers(String group, Collection<String> users) throws FreeIpaClientException { FreeIpaChecks.checkGroupNotUnmanaged(group, () -> String.format("Group '%s' is not managed and membership cannot be changed", group)); List<Object> flags = List.of(group); Map<String, Object> params = Map.of( "user", users ); return invoke("group_add_member", flags, params, Group.class); } FreeIpaClient(JsonRpcHttpClient jsonRpcHttpClient, String apiAddress, String hostname);  FreeIpaClient(JsonRpcHttpClient jsonRpcHttpClient, String apiVersion, String apiAddress, String hostname); String getApiAddress(); String getHostname(); User userShow(String user); Optional<User> userFind(String user); Set<User> userFindAll(); Set<Role> findAllRole(); Privilege showPrivilege(String privilegeName); Set<Host> findAllHost(); Host deleteHost(String fqdn); Set<IpaServer> findAllServers(); Host deleteServer(String fqdn); Host addHost(String fqdn); User deleteUser(String userUid); Role deleteRole(String roleName); User userAdd(String user, String firstName, String lastName); void userSetPasswordWithExpiration(String user, String password, Optional<Instant> expiration); void updateUserPasswordExpiration(String user, Optional<Instant> expiration); void updateUserPasswordMaxExpiration(String user); User userSetWorkloadCredentials(String user, String hashedPassword,
            String unencryptedKrbPrincipalKey, Optional<Instant> expiration,
            List<String> sshPublicKeys); User userMod(String user, String key, Object value); User userMod(String user, Map<String, Object> params); Group groupAdd(String group); void deleteGroup(String group); RPCResponse<Group> groupAddMembers(String group, Collection<String> users); RPCResponse<Group> groupRemoveMembers(String group, Collection<String> users); Set<Group> groupFindAll(); String getRootCertificate(); Set<Cert> findAllCert(); void revokeCert(int serialNumber); void addPasswordExpirationPermission(String permission); Set<Permission> findPermission(String permission); int getUsernameLength(); Config getConfig(); void setUsernameLength(int length); void addPermissionToPrivilege(String privilege, String permission); void addPermissionsToPrivilege(String privilege, List<String> permissions); Set<DnsZone> findAllDnsZone(); Set<DnsZone> findDnsZone(String cidr); DnsZone setDnsZoneAuthoritativeNameserver(String dnsZone, String authoritativeNameserverFqdn); Set<Service> findAllService(); Service deleteService(String canonicalPrincipal); Service addService(String canonicalPrincipal); Service addServiceAlias(String canonicalPrincipal, String principalname); Role addRole(String roleName); Role addRolePrivileges(String roleName, Set<String> privilegeNames); Role showRole(String roleName); Role addRoleMember(String roleName, Set<String> users, Set<String> groups, Set<String> hosts, Set<String> hostgroups, Set<String> services); Service showService(String canonicalPrincipal); DnsZone addReverseDnsZone(String cidr); DnsRecord getDnsRecord(String dnsZoneName, String recordName); DnsRecord addDnsCnameRecord(String dnsZoneName, String recordName, String cnameRecord); RPCResponse<Object> deleteDnsZone(String... dnsZoneNames); Set<DnsRecord> findAllDnsRecordInZone(String dnsZoneName); RPCResponse<Object> deleteDnsRecord(String recordName, String dnsZoneName); RPCResponse<Object> deleteDnsSrvRecord(String recordName, String dnsZoneName, List<String> srvRecords); void allowServiceKeytabRetrieval(String canonicalPrincipal, String user); void allowHostKeytabRetrieval(String fqdn, String user); Keytab getExistingKeytab(String canonicalPrincipal); Keytab getKeytab(String canonicalPrincipal); Host showHost(String fqdn); RPCResponse<Boolean> serverConnCheck(String cn, String remoteCn); RPCResponse<T> invoke(String method, List<Object> flags, Map<String, Object> params, Type resultType); PasswordPolicy getPasswordPolicy(); void updatePasswordPolicy(Map<String, Object> params); List<TopologySuffix> findAllTopologySuffixes(); List<TopologySegment> findTopologySegments(String topologySuffixCn); TopologySegment addTopologySegment(String topologySuffixCn, TopologySegment topologySegment); TopologySegment deleteTopologySegment(String topologySuffixCn, TopologySegment topologySegment); }
FreeIpaClient { public RPCResponse<Group> groupAddMembers(String group, Collection<String> users) throws FreeIpaClientException { FreeIpaChecks.checkGroupNotUnmanaged(group, () -> String.format("Group '%s' is not managed and membership cannot be changed", group)); List<Object> flags = List.of(group); Map<String, Object> params = Map.of( "user", users ); return invoke("group_add_member", flags, params, Group.class); } FreeIpaClient(JsonRpcHttpClient jsonRpcHttpClient, String apiAddress, String hostname);  FreeIpaClient(JsonRpcHttpClient jsonRpcHttpClient, String apiVersion, String apiAddress, String hostname); String getApiAddress(); String getHostname(); User userShow(String user); Optional<User> userFind(String user); Set<User> userFindAll(); Set<Role> findAllRole(); Privilege showPrivilege(String privilegeName); Set<Host> findAllHost(); Host deleteHost(String fqdn); Set<IpaServer> findAllServers(); Host deleteServer(String fqdn); Host addHost(String fqdn); User deleteUser(String userUid); Role deleteRole(String roleName); User userAdd(String user, String firstName, String lastName); void userSetPasswordWithExpiration(String user, String password, Optional<Instant> expiration); void updateUserPasswordExpiration(String user, Optional<Instant> expiration); void updateUserPasswordMaxExpiration(String user); User userSetWorkloadCredentials(String user, String hashedPassword,
            String unencryptedKrbPrincipalKey, Optional<Instant> expiration,
            List<String> sshPublicKeys); User userMod(String user, String key, Object value); User userMod(String user, Map<String, Object> params); Group groupAdd(String group); void deleteGroup(String group); RPCResponse<Group> groupAddMembers(String group, Collection<String> users); RPCResponse<Group> groupRemoveMembers(String group, Collection<String> users); Set<Group> groupFindAll(); String getRootCertificate(); Set<Cert> findAllCert(); void revokeCert(int serialNumber); void addPasswordExpirationPermission(String permission); Set<Permission> findPermission(String permission); int getUsernameLength(); Config getConfig(); void setUsernameLength(int length); void addPermissionToPrivilege(String privilege, String permission); void addPermissionsToPrivilege(String privilege, List<String> permissions); Set<DnsZone> findAllDnsZone(); Set<DnsZone> findDnsZone(String cidr); DnsZone setDnsZoneAuthoritativeNameserver(String dnsZone, String authoritativeNameserverFqdn); Set<Service> findAllService(); Service deleteService(String canonicalPrincipal); Service addService(String canonicalPrincipal); Service addServiceAlias(String canonicalPrincipal, String principalname); Role addRole(String roleName); Role addRolePrivileges(String roleName, Set<String> privilegeNames); Role showRole(String roleName); Role addRoleMember(String roleName, Set<String> users, Set<String> groups, Set<String> hosts, Set<String> hostgroups, Set<String> services); Service showService(String canonicalPrincipal); DnsZone addReverseDnsZone(String cidr); DnsRecord getDnsRecord(String dnsZoneName, String recordName); DnsRecord addDnsCnameRecord(String dnsZoneName, String recordName, String cnameRecord); RPCResponse<Object> deleteDnsZone(String... dnsZoneNames); Set<DnsRecord> findAllDnsRecordInZone(String dnsZoneName); RPCResponse<Object> deleteDnsRecord(String recordName, String dnsZoneName); RPCResponse<Object> deleteDnsSrvRecord(String recordName, String dnsZoneName, List<String> srvRecords); void allowServiceKeytabRetrieval(String canonicalPrincipal, String user); void allowHostKeytabRetrieval(String fqdn, String user); Keytab getExistingKeytab(String canonicalPrincipal); Keytab getKeytab(String canonicalPrincipal); Host showHost(String fqdn); RPCResponse<Boolean> serverConnCheck(String cn, String remoteCn); RPCResponse<T> invoke(String method, List<Object> flags, Map<String, Object> params, Type resultType); PasswordPolicy getPasswordPolicy(); void updatePasswordPolicy(Map<String, Object> params); List<TopologySuffix> findAllTopologySuffixes(); List<TopologySegment> findTopologySegments(String topologySuffixCn); TopologySegment addTopologySegment(String topologySuffixCn, TopologySegment topologySegment); TopologySegment deleteTopologySegment(String topologySuffixCn, TopologySegment topologySegment); static final String MAX_PASSWORD_EXPIRATION_DATETIME; }