Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to repository documentation, including updated contributors guide #5886

Merged
merged 1 commit into from Feb 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
89 changes: 89 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,89 @@
# Keycloak Community

Keycloak is an Open Source Identity and Access Management solution for modern Applications and Services.

## Building and working with the codebase

Details for building from source and working with the codebase are provided in the [building and working with the code base](docs/building.md) guide.

## Contributing to Keycloak

Keycloak is an Open Source community-driven project and we welcome contributions as well as feedback from the community.

We do have a few guidelines in place to help you be successful with your contribution to Keycloak.

Here's a quick checklist for a good PR, more details below:

1. [Keycloak Dev Mailing List](https://lists.jboss.org/mailman/listinfo/keycloak-dev)
2. A JIRA associated with the PR
3. One feature/change per PR
4. One commit per PR
5. PR rebased on master (`git rebase`, not `git pull`)
5. Commit message is prefixed by JIRA number
6. No changes to code not directly related to your PR
7. Includes functional/integration test
8. Includes documentation

Once you have submitted your PR please monitor it for comments/feedback. We reserve the right to close inactive PRs if
you do not respond within 2 weeks (bear in mind you can always open a new PR if it is closed due to inactivity).

Also, please remember that we do receive a fairly large amount of PRs and also have code to write ourselves, so we may
not be able to respond to your PR immediately. The best place to ping us is on the thread you started on the dev mailing list.

### Finding something to work on

If you would like to contribute to Keycloak, but are not sure exactly what to work on, you can find a number of open
issues that are awaiting contributions in the
[Keycloak JIRA](https://issues.jboss.org/projects/KEYCLOAK/versions/12340167).

### Open a discussion on Keycloak Dev Mailing List

As Keycloak is a community-driven project we require contributors to send a description of what they are planning to
work on to the [Keycloak Dev Mailing List](https://lists.jboss.org/mailman/listinfo/keycloak-dev).

We recommend starting the discussion prior to submitting your PR. Through the mailing list you can get valuable
feedback both from the core Keycloak team as well as the wider community.

### Create an issue in Keycloak JIRA

Take your time to write a proper JIRA including a good summary and description.

Remember this may be the first thing a reviewer of your PR will look at to get an idea of what you are proposing
and it will also be used by the community in the future to find about what new features and enhancements are included in
new releases.

Note: Keycloak Node.js Admin Client uses GitHub issues and not the Keycloak JIRA.

### Implementing

Details for building from source and working with the codebase are provided in the
[building and working with the code base](docs/building.md) guide.

Do not format or refactor code that is not directly related to your contribution. If you do this it will significantly
increase our effort in reviewing your PR. If you have a strong need to refactor code then submit a separate PR for the
refactoring.

### Testing

Details for implementing tests are provided in the [writing tests](docs/tests-development.md) guide.

Do not add mock frameworks or other testing frameworks that are not already part of the testsuite. Please write tests
in the same way as we have written our tests.

### Submitting your PR

When preparing your PR make sure you have a single commit and your branch is rebased on the master branch from the
project repository.

This means use the `git rebase` command and not `git pull` when integrating changes from master to your branch. See
[Git Documentation](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) for more details.

We require that you squash to a single commit. You can do this with the `git rebase -i HEAD~X` command where X
is the number of commits you want to squash. See the [Git Documentation](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History)
for more details.

The above helps us review your PR and also makes it easier for us to maintain the repository. It is also required by
our automatic merging process.

We also require that the commit message is prefixed with the Keycloak JIRA issue number (example commit message
"KEYCLOAK-9876 My super cool new feature").
100 changes: 44 additions & 56 deletions README.md
@@ -1,84 +1,72 @@
Keycloak
========
# Keycloak

Open Source Identity and Access Management for modern Applications and Services.
Keycloak is an Open Source Identity and Access Management solution for modern Applications and Services.

For more information about Keycloak visit [Keycloak homepage](http://keycloak.org) and [Keycloak blog](http://blog.keycloak.org).
This repository contains the source code for the Keycloak Server, Java adapters and the JavaScript adapter.


Building
--------
## Help and Documentation

Ensure you have JDK 8 (or newer), Maven 3.1.1 (or newer) and Git installed
* [Documentation](https://www.keycloak.org/documentation.html)
* [User Mailing List](https://lists.jboss.org/mailman/listinfo/keycloak-user) - Mailing list for help and general questions about Keycloak
* [JIRA](https://issues.jboss.org/projects/KEYCLOAK) - Issue tracker for bugs and feature requests

java -version
mvn -version
git --version

First clone the Keycloak repository:

git clone https://github.com/keycloak/keycloak.git
cd keycloak

To build Keycloak run:

mvn install

This will build all modules and run the testsuite.
## Reporting Security Vulnerabilities

If you've found a security vulnerability, please look at the [instructions on how to properly report it](http://www.keycloak.org/security.html)


## Reporting an issue

To build the distribution run:
If you believe you have discovered a defect in Keycloak please open an issue in our [Issue Tracker](https://issues.jboss.org/projects/KEYCLOAK).
Please remember to provide a good summary, description as well as steps to reproduce the issue.

mvn install -Pdistribution

## Getting started

To run Keycloak download the distribution from our [website](https://www.keycloak.org/downloads.html). Unzip and run:

bin/standalone.[sh|bat]

Alternatively, you can use the Docker image by running:

docker run jboss/keycloak

Once completed you will find distribution archives in `distribution`.
For more details refer to the [Keycloak Documentation](https://www.keycloak.org/documentation.html).

To build only the server run:

mvn -Pdistribution -pl distribution/server-dist -am -Dmaven.test.skip clean install
## Building from Source

To build from source refer to the [building and working with the code base](docs/building.md) guide.

Starting Keycloak
-----------------

To start Keycloak during development first build as specified above, then run:
### Testing

mvn -f testsuite/utils/pom.xml exec:java -Pkeycloak-server
To run tests refer to the [running tests](docs/tests.md) guide.

When running testsuite, by default an account with username `admin` and password `admin` will be created within the master realm at start.

To start Keycloak from the server distribution first build the distribution it as specified above, then run:
### Writing Tests

tar xfz distribution/server-dist/target/keycloak-<VERSION>.tar.gz
cd keycloak-<VERSION>
bin/standalone.sh

To stop the server press `Ctrl + C`.
To write tests refer to the [writing tests](docs/tests-development.md) guide.

Reporting security vulnerabilities
----------------------------------

If you've found a security vulnerability, please look at the [instructions on how to properly report it](http://www.keycloak.org/security.html)
## Contributing

Help and Documentation
----------------------
* [Documentation](http://www.keycloak.org/documentation.html) - User Guide, Admin REST API and Javadocs
* [User Mailing List](https://lists.jboss.org/mailman/listinfo/keycloak-user) - Mailing list to ask for help and general questions about Keycloak
* [JIRA](https://issues.jboss.org/projects/KEYCLOAK) - Issue tracker for bugs and feature requests
Before contributing to Keycloak please read our [contributing guidelines](CONTRIBUTING.md).


Contributing
------------
## Other Keycloak Projects

* Developer documentation
* [Hacking on Keycloak](misc/HackingOnKeycloak.md) - How to become a Keycloak contributor
* [Testsuite](misc/Testsuite.md) - Details about testsuite, but also how to quickly run Keycloak during development and a few test tools (OTP generation, LDAP server, Mail server)
* [Database Testing](misc/DatabaseTesting.md) - How to do testing of Keycloak on different databases
* [Updating Database](misc/UpdatingDatabaseSchema.md) - How to change the Keycloak database
* [Changing the Default keycloak-subsystem Configuration](misc/UpdatingServerConfig.md) - How to update the default keycloak-subsystem config
* [Developer Mailing List](https://lists.jboss.org/mailman/listinfo/keycloak-dev) - Mailing list to discuss development of Keycloak
* [Keycloak](https://github.com/keycloak/keycloak) - Keycloak Server and Java adapters
* [Keycloak Documentation](https://github.com/keycloak/keycloak-documentation) - Documentation for Keycloak
* [Keycloak QuickStarts](https://github.com/keycloak/keycloak-quickstarts) - QuickStarts for getting started with Keycloak
* [Keycloak Docker](https://github.com/jboss-dockerfiles/keycloak) - Docker images for Keycloak
* [Keycloak Gatekeeper](https://github.com/keycloak/keycloak-gatekeeper) - Proxy service to secure apps and services with Keycloak
* [Keycloak Node.js Connect](https://github.com/keycloak/keycloak-nodejs-connect) - Node.js adapter for Keycloak
* [Keycloak Node.js Admin Client](https://github.com/keycloak/keycloak-nodejs-admin-client) - Node.js library for Keycloak Admin REST API


License
-------
## License

* [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
* [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
57 changes: 57 additions & 0 deletions docs/building.md
@@ -0,0 +1,57 @@
## Building from source

Ensure you have JDK 8 (or newer), Maven 3.1.1 (or newer) and Git installed

java -version
mvn -version
git --version

First clone the Keycloak repository:

git clone https://github.com/keycloak/keycloak.git
cd keycloak

To build Keycloak run:

mvn install

This will build all modules and run the testsuite.

To build the ZIP distribution run:

mvn install -Pdistribution

Once completed you will find distribution archives in `distribution`.

To build only the server run:

mvn -Pdistribution -pl distribution/server-dist -am -Dmaven.test.skip clean install


## Starting Keycloak

To start Keycloak during development first build as specified above, then run:

mvn -f testsuite/utils/pom.xml exec:java -Pkeycloak-server

When running testsuite, by default an account with username `admin` and password `admin` will be created within the master realm at start.

To start Keycloak from the server distribution first build the distribution it as specified above, then run:

tar xfz distribution/server-dist/target/keycloak-<VERSION>.tar.gz
cd keycloak-<VERSION>
bin/standalone.sh

To stop the server press `Ctrl + C`.


## Working with the codebase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO we should refer to CONTRIBUTING.md instead


We don't currently enforce a code style in Keycloak, but a good reference is the code style used by WildFly. This can be
retrieved from [Wildfly ide-configs](https://github.com/wildfly/wildfly-core/tree/master/ide-configs).To import formatting
rules, see following [instructions](http://community.jboss.org/wiki/ImportFormattingRules).

If your changes require updates to the database read [Updating Database Schema](updating-database-schema.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in CONTRIBUTING.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanted CONTRIBUTING.md to be a generic file that is the same for all repositories. So it refers to building guide. I've added an explicit link to the guide now.


If your changes require introducing new dependencies or updating dependency versions please discuss this first on the
dev mailing list. We do not accept new dependencies to be added lightly, so try to use what is available.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This too

24 changes: 24 additions & 0 deletions docs/test-development.md
@@ -0,0 +1,24 @@
## Writing tests

We focus primarily on integration/functional level tests. Unit tests are avoided and only recommended for isolated
classes such as small utils. We do not use any mocking frameworks and we will not accept any contributions that adds a
mocking framework.

When writing tests please follow the same approach as we have taken in the other tests. There are many ways to
test software and we have chosen ours, so please appreciate that.

The main tests are provided in testsuite/integration-arquillian/tests/base. Most server tests are here.

Integration tests can be executed from the IDE in the same way as you would run unit tests. When ran from within the
IDE an embedded Keycloak server is executed automatically.

A good test to start looking at is org.keycloak.testsuite.forms.LoginTest. It is reasonable straightforward to understand
this test.

When developing your test depending on the feature or enhancement you are testing you may find it best to add to an
existing test, or to write a test from scratch. For the latter, we recommend finding another test that is close to what
you need and use that as a basis.

All tests don't have to be fully black box testing as the testsuite deploys a special feature to the Keycloak server
that allows running code within the server. This allows writing tests that can execute functions not exposed through
APIs as well as access data that is not exposed. For an example on how to do this look at org.keycloak.testsuite.runonserver.RunOnServerTest.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions misc/Testsuite.md → docs/tests.md
@@ -1,5 +1,5 @@
Executing testsuite
===================
Executing tests
===============

Browser
-------
Expand All @@ -11,7 +11,7 @@ To run the tests with Firefox add `-Dbrowser=firefox` or for Chrome add `-Dbrows
Database
--------

By default the testsuite uses an embedded H2 database to test with other databases see (Database Testing)[DatabaseTesting.md].
By default the testsuite uses an embedded H2 database to test with other databases see (Database Testing)[tests-db.md].

Test utils
==========
Expand Down
File renamed without changes.
File renamed without changes.
77 changes: 0 additions & 77 deletions misc/HackingOnKeycloak.md

This file was deleted.