Compare commits
8 commits
149d98f90e
...
d38c4ab6a6
| Author | SHA1 | Date | |
|---|---|---|---|
| d38c4ab6a6 | |||
| c6f7d2f335 | |||
| 510c045070 | |||
| 218ee1dd57 | |||
| f204ab7f28 | |||
| 6cd678b414 | |||
| 89ce38f6c1 | |||
| 0a84d2ddf9 |
5 changed files with 27 additions and 27 deletions
|
|
@ -1,10 +1,12 @@
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
ansible-lint:
|
||||||
name: Test
|
name: Verify
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
|
|
@ -12,6 +14,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
apt update
|
apt update
|
||||||
apt install -y maven
|
apt install -y maven
|
||||||
- name: Run maven verify test
|
- name: Run maven verify
|
||||||
run: |
|
run: |
|
||||||
mvn -f attribute-endpoints-provider verify test
|
mvn -f attribute-endpoints-provider --batch-mode --no-transfer-progress verify
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# Attribute Endpoints Provider - Export User Attributes
|
# Attribute Endpoints Provider - Export User Attributes
|
||||||
|
|
||||||
This is a Keycloak Provider that exports user profile attribute values.
|
This is a Keycloak Provider that exports user profile attribute values.
|
||||||
The selection of attributes and authorization is manage through an endpoint configuration.
|
The selection of attributes and authorization is managed through an endpoint configuration in the Keycloak admin website.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ Once all dependencies are met, simply call `make` to build the provider, which s
|
||||||
|
|
||||||
There's also `make clean` available for removing the output directory.
|
There's also `make clean` available for removing the output directory.
|
||||||
|
|
||||||
To add the provider to your Keycloak install, copy `attribute-endpoints-provider/target/attribute-endpoints-provider-1.0-SNAPSHOT.jar` to the Keycloak Provider directory (`/opt/keycloak/providers/).
|
To add the provider to your Keycloak install, copy `attribute-endpoints-provider/target/attribute-endpoints-provider-1.0-SNAPSHOT.jar` to the Keycloak Provider directory (`/opt/keycloak/providers/`).
|
||||||
|
|
||||||
## Testing Setup
|
## Testing Setup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,7 @@ public class AdminUiPage implements UiPageProvider, UiPageProviderFactory<Compon
|
||||||
.add()
|
.add()
|
||||||
|
|
||||||
.property()
|
.property()
|
||||||
|
// keep old name for backwards compatibility
|
||||||
.name("attribute-group")
|
.name("attribute-group")
|
||||||
.label("Attribute Name or Group")
|
.label("Attribute Name or Group")
|
||||||
.helpText("The attribute or attribute group to export.")
|
.helpText("The attribute or attribute group to export.")
|
||||||
|
|
|
||||||
|
|
@ -1,36 +1,35 @@
|
||||||
package de.ccc.hamburg.keycloak.attribute_endpoints;
|
package de.ccc.hamburg.keycloak.attribute_endpoints;
|
||||||
|
|
||||||
|
import com.google.auto.service.AutoService;
|
||||||
import org.keycloak.Config;
|
import org.keycloak.Config;
|
||||||
import org.keycloak.models.KeycloakSession;
|
import org.keycloak.models.KeycloakSession;
|
||||||
import org.keycloak.models.KeycloakSessionFactory;
|
import org.keycloak.models.KeycloakSessionFactory;
|
||||||
import org.keycloak.services.resource.RealmResourceProvider;
|
import org.keycloak.services.resource.RealmResourceProvider;
|
||||||
import org.keycloak.services.resource.RealmResourceProviderFactory;
|
import org.keycloak.services.resource.RealmResourceProviderFactory;
|
||||||
|
|
||||||
import com.google.auto.service.AutoService;
|
|
||||||
|
|
||||||
@AutoService(RealmResourceProviderFactory.class)
|
@AutoService(RealmResourceProviderFactory.class)
|
||||||
public class AttributeEndpointsResourceProviderFactory implements RealmResourceProviderFactory {
|
public class AttributeEndpointsResourceProviderFactory implements RealmResourceProviderFactory {
|
||||||
static final String PROVIDER_ID = "attribute-endpoints-provider";
|
static final String PROVIDER_ID = "attribute-endpoints-provider";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RealmResourceProvider create(KeycloakSession keycloakSession) {
|
public RealmResourceProvider create(KeycloakSession keycloakSession) {
|
||||||
return new AttributeEndpointsResourceProvider(keycloakSession);
|
return new AttributeEndpointsResourceProvider(keycloakSession);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Config.Scope config) {
|
public void init(Config.Scope config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postInit(KeycloakSessionFactory keycloakSessionFactory) {
|
public void postInit(KeycloakSessionFactory keycloakSessionFactory) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return PROVIDER_ID;
|
return PROVIDER_ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,7 @@ import java.util.Map;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertThrows;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.mockito.ArgumentMatchers.*;
|
import static org.mockito.ArgumentMatchers.*;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue