Skip to content

Commit

Permalink
ldap, console : new orgUniqueId georchestra#4374 georchestra#4372 geo…
Browse files Browse the repository at this point in the history
…rchestra/georchestra-gateway#159

Add organizationId object

Fix olcAttribute type uniqueOrganizationId

Console - new form field - uniqueOrganizationId

Custom proconnect tag for docker image

ldap management - add new uniqueOrganizationId

up attribute and add siret c2c info

new uniqueOrganizationId field in orgDao
  • Loading branch information
Gaetanbrl committed Jan 6, 2025
1 parent bfd103a commit 430c5e4
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Docker related targets

GEOSERVER_EXTENSION_PROFILES=wps-download,app-schema,control-flow,csw,inspire,libjpeg-turbo,monitor,pyramid,wps,css,jp2k,authkey,mapstore2,mbstyle,web-resource,sldservice,geopkg-output
BTAG=latest
BTAG=proconnect

docker-pull-jetty:
docker pull jetty:9-jre11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
private String url;
private String orgType;
private String mail;
private String uniqueOrganizationId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public String edit(Model model, @ModelAttribute EditOrgDetailsFormBean formBean,
validation.validateOrgField("url", formBean.getUrl(), resultErrors);
validation.validateOrgField("address", formBean.getAddress(), resultErrors);
validation.validateOrgField("description", formBean.getDescription(), resultErrors);
validation.validateOrgField("uniqueOrganizationId", formBean.getUniqueOrganizationId(), resultErrors);
// TODO validate mail address for the organization ?

if (resultErrors.hasErrors()) {
Expand All @@ -122,6 +123,7 @@ public String edit(Model model, @ModelAttribute EditOrgDetailsFormBean formBean,
orgOrigin.setDescription(formBean.getDescription());
orgOrigin.setUrl(formBean.getUrl());
orgOrigin.setAddress(formBean.getAddress());
orgOrigin.setUniqueOrganizationId(formBean.getUniqueOrganizationId());

if (!logo.isEmpty()) {
orgOrigin.setLogo(transformLogoFileToBase64(logo));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ org.creation.orgDescription=Description
org.creation.orgUrl=Url
org.creation.orgMail=Mail
org.creation.orgLogo=Logo
org.creation.orgUniqueId=Identification number
org.shortNameFormat=Short name must only contain alphanumeric characters
password.label=Password
password.placeholder=Password
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ org.creation.orgDescription=Description
org.creation.orgUrl=Url
org.creation.orgMail=Mail
org.creation.orgLogo=Logo
org.creation.orgUniqueId=Numéro d'identification
org.shortNameFormat=Le nom court ne doit comporter que des caractères alphanumériques
password.label=Mot de passe
password.placeholder=Mot de passe
Expand Down
4 changes: 4 additions & 0 deletions console/src/main/webapp/WEB-INF/views/createAccountForm.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@
<jsp:attribute name="label"><s:message code="org.creation.orgLogo"/></jsp:attribute>
</t:textarea>

<t:textarea path="orgUniqueId" required="${orgUniqueIdRequired}">
<jsp:attribute name="uniqueOrganizationId"><s:message code="org.creation.orgUniqueId"/></jsp:attribute>
</t:textarea>

<link rel="stylesheet" href="/console/manager/public/libraries.css">
<link rel="stylesheet" href="/console/manager/public/app.css">
<style>
Expand Down
1 change: 1 addition & 0 deletions console/src/main/webapp/manager/app/assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
"org.description" : "Description",
"org.url" : "Website",
"org.mail" : "Mail",
"org.uniqueOrganizationId": "Identification number",
"org.logo" : "Logo",
"org.note" : "Internal Notes",
"org.cities" : "Area",
Expand Down
1 change: 1 addition & 0 deletions console/src/main/webapp/manager/app/assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
"org.description" : "Description",
"org.url" : "Site web",
"org.mail" : "Mail",
"org.uniqueOrganizationId": "Numéro d'identification",
"org.logo" : "Logo",
"org.note" : "Notes Internes",
"org.cities" : "Aire de compétence",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class OrgsController {
delete org.members
})
this.simplifiedOrgs = this.orgs.map((org) => {
return { id: org.id, name: org.name, shortName: org.shortName, membersCount: org.membersCount, pending: org.pending, status: org.status }
return { id: org.id, name: org.name, shortName: org.shortName, membersCount: org.membersCount, pending: org.pending, status: org.status, uniqueOrganizationId: org.uniqueOrganizationId }
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@
placeholder="" ng-required="required.mail">
</div>
</div>
<div class="form-group form-group-sm" ng-class="{required: required.uniqueOrganizationId}">
<label class="col-sm-4" for="uniqueOrganizationId" translate>org.uniqueOrganizationId</label>
<div class="col-sm-8">
<input ng-model="model.uniqueOrganizationId" class="form-control" id="uniqueOrganizationId"
placeholder="">
</div>
</div>

<imageinput model="model" attribute="'logo'"></imageinput>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class Org extends ReferenceAware implements Comparable<Org>, Cloneable {
public static final String JSON_ADDRESS = "address";
public static final String JSON_ORG_TYPE = "orgType";
public static final String JSON_MAIL = "mail";
public static final String JSON_UNIQUE_ORGANIZATION_ID = "uniqueOrganizationId";

private String id;
private String name;
Expand Down Expand Up @@ -180,4 +181,13 @@ public String getMail() {
public void setMail(String mail) {
this.ext.setMail(mail);
}

@JsonProperty(JSON_UNIQUE_ORGANIZATION_ID)
public void setUniqueOrganizationId(String uniqueOrganizationId) {
this.ext.setUniqueOrganizationId(uniqueOrganizationId);
}

public String getUniqueOrganizationId() {
return this.ext.getUniqueOrganizationId();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class OrgExt extends ReferenceAware implements Cloneable {
private String logo = "";
private String note = "";
private String mail = "";
private String uniqueOrganizationId = "";

@Override
public OrgExt clone() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public interface OrgsDao {

public Org findByUser(Account user);

public Org findByUniqueOrganizationId(String uniqueOrganizationId);

/**
* Search by {@link Org#getUniqueIdentifier()}
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ public Org mapFromAttributes(Attributes attrs) throws NamingException {
.map(LdapNameBuilder::build).map(name -> name.getRdn(name.size() - 1).getValue().toString())
.collect(Collectors.toList()));
org.setPending(pending);
org.setUniqueOrganizationId(asStringStream(attrs, "uniqueOrganizationId").collect(joining(",")));
return org;
}
};
Expand Down Expand Up @@ -396,6 +397,13 @@ public Org findById(UUID uuid) {
return findAllWithExt().filter(o -> uuid.equals(o.getUniqueIdentifier())).findFirst().orElse(null);
}

@Override
public Org findByUniqueOrganizationId(String uniqueOrganizationId) {
return findAllWithExt().filter(o -> uniqueOrganizationId.equals(o.getUniqueOrganizationId())).findFirst()
.orElse(null);

}

private Org addExt(Org org) {
if (org == null) {
return null;
Expand Down
1 change: 1 addition & 0 deletions ldap/docker-root/georchestra.ldif
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ o: C2C
mail: [email protected]
businessCategory: Company
postalAddress: 18 Rue du lac Saint André, 73000 Chambéry
uniqueOrganizationId: 43369857800054
labeledURI: https://www.camptocamp.com/
description: Camptocamp SAS France
knowledgeInformation: Internal CRM notes on Camptocamp
Expand Down
14 changes: 10 additions & 4 deletions ldap/docker-root/georchestraSchema.ldif
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,31 @@ olcAttributeTypes: ( 1.3.6.1.4.1.53611.1.2.2
SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.53611.1.2.3
NAME 'oAuth2Provider'
DESC 'OAuth2 provider for external identity provider users)'
DESC 'OAuth2 provider for external identity provider users'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.53611.1.2.4
NAME 'oAuth2Uid'
DESC 'OAuth2 UID for external identity provider users)'
DESC 'OAuth2 UID for external identity provider users'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.53611.1.2.5
NAME 'uniqueOrganizationId'
DESC 'organization UID such as SIRET or other'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE)
olcObjectClasses: ( 1.3.6.1.4.1.53611.1.1.2
NAME 'georchestraOrg'
DESC 'georchestra org'
SUP top
AUXILIARY
MAY (jpegphoto $ labeledURI $ knowledgeInformation $ georchestraObjectIdentifier))
MAY (jpegphoto $ labeledURI $ knowledgeInformation $ georchestraObjectIdentifier $ uniqueOrganizationId))
olcObjectClasses: ( 1.3.6.1.4.1.53611.1.1.3
NAME 'georchestraRole'
DESC 'Uniquely identifiable georchestra role'
SUP top
AUXILIARY
MAY (georchestraObjectIdentifier))
MAY (georchestraObjectIdentifier))

0 comments on commit 430c5e4

Please sign in to comment.