Thank you for investing your time in contributing to our project!
In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR.
The INDIGO IAM service is a Maven project built with Java 17.
To download the necessary dependencies from the CNAF Repository platform (e.g. to include the patched version of MitreID), add the maven settings file locally, at ~/.m2/settings.xml
.
Run
$ mvn package
to build the project, or
$ mvn package -DskipTests
to skip tests execution.
You can use your favorite IDE for development.
In case you are using Eclipse:
- install the
Spring Tools 4
plugin to use Spring buttons and configurations - import the Java Google style formatter (available here) to format your code.
Visual Studio Code has a similar extension that needs to be installed.
The main package is iam-login-service, listening by default on http://localhost:8080. To run it
- enable the
h2
anddev
Spring profiles: these profiles allow to run the app in developer mode, where an in-memory database is enabled and populated with test users, clients, groups, etc. A web interface of the database is available at http://localhost:8080/h2-console. A test administrator can login into IAM with admin/password credentials, while a test user with test/password. Connection to the database is possible by inserting the following parameters:- Driver Class: org.h2.Driver
- JDBC URL: jdbc:h2:mem:iam
- User Name: sa
- Password:
- the main class to be run is
it.infn.mw.iam.IamLoginService
.
The iam-test-client package is a simple web application used to showcase an authorization code flow where iam-login-service
is the OAuth Authorization Server. It listens by default on http://localhost:9090/iam-test-client. The main class to be run is it.infn.mw.tc.IamTestClientApplication
.
The voms-aa package is a micro-service which provides backward-compatible VOMS support for a Virtual Organization managed by iam-login-service
. It listens by default on http://localhost:15000. The main class to be run is it.infn.mw.voms.VomsService
.
There are few rules that we want to follow during our development phase to make the history of this repository as clean as possible:
- the
master
branch is the one containing the latest official release - the
develop
branch is a branch with a successful build, ready for next release - when you want to develop some feature, create a new branch starting from
develop
- if you spot a problem within IAM, search if an issue already exists. If not, create a new issue
- create a new branch named
issue-<number>
- develop your own solution
- when you are satisfied with your work, create a Pull Request from branch
issue-<number>
todevelop
- wait for the GitHub workflow to finish running. If the build succeeds, a Sonar analysis for code quality runs. Please fix spotted problems, if any. We want to keep as much code coverage as possible (a lower threshold is set to 85%), so add JUnit tests to the uncovered parts of your code.
When you are finished with the changes, create a pull request, also known as a PR, and
- add someone of the team as reviewer
- link the PR to related issue
- once you submit your PR, a team member will review your proposal
- we may ask questions or request additional information
- we may ask for changes to be made before a PR can be merged, either using suggested changes or pull request comments
- as you update your PR and apply changes, mark each conversation as resolved.
Even tough we will squash all commits of a PR into an inclusive, long commit, we invite you to follow few best practices:
- fist letter of the commit must be capital
- tenses in the commit must not be past-like
- the first line of the commit must be included within 50 characters. Add a new blank line if you want to add more explanation of your commit (this will make more readable a
git log --oneline
command output, for instance).