Skip to content

Commit

Permalink
Merge pull request #251 from kbss-cvut/development
Browse files Browse the repository at this point in the history
[3.0.2] Release
  • Loading branch information
ledsoft authored Nov 15, 2023
2 parents 7d99cd5 + 754cc32 commit 8c33cba
Show file tree
Hide file tree
Showing 516 changed files with 7,656 additions and 2,053 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
#
# TermIt
# Copyright (C) 2023 Czech Technical University in Prague
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

FROM maven:3-eclipse-temurin-17 as build

WORKDIR /termit
Expand Down
36 changes: 31 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.3</version>
<version>3.1.5</version>
</parent>

<artifactId>termit</artifactId>
<version>3.0.1</version>
<version>3.0.2</version>
<name>TermIt</name>
<description>Terminology manager based on Semantic Web technologies.</description>
<packaging>${packaging}</packaging>
Expand All @@ -28,8 +28,8 @@
<org.apache.tika.tika-core.version>2.7.0</org.apache.tika.tika-core.version>
<org.mapstruct.version>1.5.5.Final</org.mapstruct.version>
<org.springdoc.version>2.2.0</org.springdoc.version>
<cz.cvut.kbss.jopa.version>1.1.3</cz.cvut.kbss.jopa.version>
<cz.cvut.kbss.jsonld.version>0.13.2</cz.cvut.kbss.jsonld.version>
<cz.cvut.kbss.jopa.version>1.1.4</cz.cvut.kbss.jopa.version>
<cz.cvut.kbss.jsonld.version>0.14.0</cz.cvut.kbss.jsonld.version>
<org.aspectj.version>1.9.20</org.aspectj.version>

<!-- Default value for deployment type property which should otherwise specified on command line -->
Expand Down Expand Up @@ -110,7 +110,7 @@
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-rio-rdfxml</artifactId>
<version>4.3.4</version>
<version>4.3.7</version>
</dependency>


Expand Down Expand Up @@ -575,6 +575,32 @@
</execution>
</executions>
</plugin>
<!-- use mvn license:check to check for missing license headers, mvn license:format to add license headers -->
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>3.0</version>
<configuration>
<mapping>
<java>SLASHSTAR_STYLE</java>
</mapping>
<header>header.txt</header>
<excludes>
<exclude>.github/**</exclude>
<exclude>src/test/resources/**</exclude>
<exclude>src/main/resources/**</exclude>
<exclude>license.txt</exclude>
<exclude>README.md</exclude>
<exclude>**/*.txt</exclude>
<exclude>**/*.md</exclude>
<exclude>**/*.yml</exclude>
<exclude>**/*.ttl</exclude>
<exclude>**/*.sh</exclude>
<exclude>pom.xml</exclude>
<exclude>.editorconfig</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>de.qaware.maven</groupId>
<artifactId>go-offline-maven-plugin</artifactId>
Expand Down
22 changes: 19 additions & 3 deletions src/main/java/cz/cvut/kbss/termit/TermItApplication.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
/*
* TermIt
* Copyright (C) 2023 Czech Technical University in Prague
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package cz.cvut.kbss.termit;

import cz.cvut.kbss.termit.util.Configuration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.security.core.context.SecurityContextHolder;

@SpringBootApplication
@EnableConfigurationProperties({Configuration.class, Configuration.Persistence.class, Configuration.Repository.class})
@ConfigurationPropertiesScan
public class TermItApplication extends SpringBootServletInitializer {

@Override
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/cz/cvut/kbss/termit/aspect/ChangeTrackingAspect.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* TermIt
* Copyright (C) 2023 Czech Technical University in Prague
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package cz.cvut.kbss.termit.aspect;

import cz.cvut.kbss.termit.model.Asset;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* TermIt
* Copyright (C) 2023 Czech Technical University in Prague
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package cz.cvut.kbss.termit.aspect;

import cz.cvut.kbss.termit.asset.provenance.SupportsLastModification;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* TermIt
* Copyright (C) 2023 Czech Technical University in Prague
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package cz.cvut.kbss.termit.aspect;

import cz.cvut.kbss.termit.event.VocabularyContentModified;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* TermIt
* Copyright (C) 2023 Czech Technical University in Prague
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package cz.cvut.kbss.termit.asset.provenance;

import cz.cvut.kbss.termit.aspect.RefreshLastModifiedAspect;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* TermIt
* Copyright (C) 2023 Czech Technical University in Prague
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package cz.cvut.kbss.termit.asset.provenance;

/**
Expand Down
29 changes: 16 additions & 13 deletions src/main/java/cz/cvut/kbss/termit/config/AppConfig.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
/**
* TermIt Copyright (C) 2019 Czech Technical University in Prague
* <p>
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
* version.
* <p>
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* <p>
* You should have received a copy of the GNU General Public License along with this program. If not, see
* <https://www.gnu.org/licenses/>.
/*
* TermIt
* Copyright (C) 2023 Czech Technical University in Prague
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package cz.cvut.kbss.termit.config;

Expand Down
17 changes: 17 additions & 0 deletions src/main/java/cz/cvut/kbss/termit/config/CacheConfig.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* TermIt
* Copyright (C) 2023 Czech Technical University in Prague
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package cz.cvut.kbss.termit.config;

import cz.cvut.kbss.termit.persistence.dao.acl.AccessControlListDao;
Expand Down
40 changes: 22 additions & 18 deletions src/main/java/cz/cvut/kbss/termit/config/OAuth2SecurityConfig.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
/*
* TermIt
* Copyright (C) 2023 Czech Technical University in Prague
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package cz.cvut.kbss.termit.config;

import cz.cvut.kbss.termit.security.AuthenticationSuccess;
import cz.cvut.kbss.termit.security.HierarchicalRoleBasedAuthorityMapper;
import cz.cvut.kbss.termit.security.SecurityConstants;
import cz.cvut.kbss.termit.util.oidc.OidcGrantedAuthoritiesExtractor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -25,9 +43,6 @@
import org.springframework.web.cors.CorsConfigurationSource;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher;

Expand Down Expand Up @@ -75,21 +90,10 @@ private CorsConfigurationSource corsConfigurationSource() {

private Converter<Jwt, AbstractAuthenticationToken> grantedAuthoritiesExtractor() {
return source -> {
final Collection<SimpleGrantedAuthority> authorities = new GrantedAuthoritiesExtractor().convert(source);
return new JwtAuthenticationToken(source, authorities);
final Collection<SimpleGrantedAuthority> authorities = new OidcGrantedAuthoritiesExtractor(
config.getSecurity()).convert(source);
return new JwtAuthenticationToken(source,
new HierarchicalRoleBasedAuthorityMapper().mapAuthorities(authorities));
};
}

private class GrantedAuthoritiesExtractor implements Converter<Jwt, Collection<SimpleGrantedAuthority>> {
public Collection<SimpleGrantedAuthority> convert(Jwt jwt) {
final List<SimpleGrantedAuthority> allAuths = (
(Map<String, Collection<?>>) jwt.getClaims().getOrDefault(
OAuth2SecurityConfig.this.config.getSecurity().getRoleClaim(), Collections.emptyMap())
).getOrDefault("roles", Collections.emptyList())
.stream()
.map(Object::toString)
.map(SimpleGrantedAuthority::new).toList();
return new HierarchicalRoleBasedAuthorityMapper().mapAuthorities(allAuths);
}
}
}
29 changes: 16 additions & 13 deletions src/main/java/cz/cvut/kbss/termit/config/PersistenceConfig.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
/**
* TermIt Copyright (C) 2019 Czech Technical University in Prague
* <p>
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
* version.
* <p>
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* <p>
* You should have received a copy of the GNU General Public License along with this program. If not, see
* <https://www.gnu.org/licenses/>.
/*
* TermIt
* Copyright (C) 2023 Czech Technical University in Prague
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package cz.cvut.kbss.termit.config;

Expand Down
Loading

0 comments on commit 8c33cba

Please sign in to comment.