Skip to content

Commit

Permalink
Prepare for 1.1.0 release (#22)
Browse files Browse the repository at this point in the history
* Preparing for next development iteration

* Update CONTRIBUTING.md (#15)

* Fix typo: s/contraint/constraint

* Ran Aspell CLI spell checker (#17)

I used an Aspell "word list" based on the "word list" from the ISLE repo found
here...
https://raw.githubusercontent.com/Islandora-Collaboration-Group/ISLE/master/.aspell.en.pws

* Update README for CLAWdit (#16)

* Update README.md

* Update README.md

* Update README.md

Nothing left but the playbook!

* 'The string "claw" was not found' or - COMPLETE DECLAW #1267 #1314 (#18)

* Update CONTRIBUTING.md

* Update README.md

* Update README.md

* Update PULL_REQUEST_TEMPLATE.md (#19)

* Moves maven URL to https (#21)

fixes: Islandora/documentation#1415

* Add a disable switch to the config XML (#20)

Co-authored-by: dannylamb <dlamb@islandora.ca>
Co-authored-by: Melissa Anez <manez@islandora.ca>
Co-authored-by: J Hunt <github.com@huntdesign.co.nz>
Co-authored-by: Yamil <ysuarez@users.noreply.github.com>
Co-authored-by: B. Seeger <bseeger@users.noreply.github.com>
  • Loading branch information
6 people authored Feb 10, 2020
1 parent 62bfeeb commit fc075f5
Show file tree
Hide file tree
Showing 7 changed files with 216 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A in-depth description of the changes made by this PR. Technical details and pos
* Removed y
* Does this change require documentation to be updated?
* Does this change add any new dependencies?
* Does this change require any other modifications to be made to the repository (ie. Regeneration activity, etc.)?
* Does this change require any other modifications to be made to the repository (i.e. Regeneration activity, etc.)?
* Could this change impact execution of existing code?

# How should this be tested?
Expand All @@ -29,4 +29,4 @@ A description of what steps someone could take to:
Any additional information that you think would be helpful when reviewing this PR.

# Interested parties
Tag (@ mention) interested parties or, if unsure, @Islandora-CLAW/committers
Tag (@ mention) interested parties or, if unsure, @Islandora/8-x-committers
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Welcome!

If you are reading this document then you are interested in contributing to the Islandora CLAW. All contributions are welcome: use-cases, documentation, code, patches, bug reports, feature requests, etc. You do not need to be a programmer to speak up!
If you are reading this document then you are interested in contributing to Islandora 8. All contributions are welcome: use-cases, documentation, code, patches, bug reports, feature requests, etc. You do not need to be a programmer to speak up!

## Workflows

The group meets each Wednesday at 1:00 PM Eastern. Meeting notes and announcements are posted to the [Islandora community list](https://groups.google.com/forum/#!forum/islandora) and the [Islandora developers list](https://groups.google.com/forum/#!forum/islandora-dev). You can view meeting agendas, notes, and call-in information [here](https://github.com/Islandora-CLAW/CLAW/wiki#islandora-claw-tech-calls). Anybody is welcome to join the calls, and add items to the agenda.
The group meets each Wednesday at 1:00 PM Eastern. Meeting notes and announcements are posted to the [Islandora community list](https://groups.google.com/forum/#!forum/islandora) and the [Islandora developers list](https://groups.google.com/forum/#!forum/islandora-dev). You can view meeting agendas, notes, and call-in information [here](https://github.com/Islandora/documentation/wiki#islandora-8-tech-calls). Anybody is welcome to join the calls, and add items to the agenda.

### Use cases

If you would like to submit a use case to the Islandora CLAW project, please submit an issue [here](https://github.com/Islandora-CLAW/CLAW/issues/new) using the [Use Case template](https://github.com/Islandora-CLAW/CLAW/wiki/Use-Case-template), prepending "Use Case:" to the title of the issue.
If you would like to submit a use case to the Islandora 8 project, please submit an issue [here](https://github.com/Islandora/documentation/issues/new) using the [Use Case template](https://github.com/Islandora/documentation/wiki/Use-Case-template), prepending "Use Case:" to the title of the issue.

### Documentation

You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/Islandora-CLAW/CLAW/issues/new), prepending "Documentation:" to the title of the issue. Another way is by pull request, which is the same process as [Contribute Code](https://github.com/Islandora-CLAW/CLAW/blob/master/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora-CLAW/CLAW/tree/master/docs).
You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/Islandora/documentation/issues/new), prepending "Documentation:" to the title of the issue. Another way is by pull request, which is the same process as [Contribute Code](https://github.com/Islandora/documentation/blob/master/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora/documentation/tree/master/docs).

### Request a new feature

To request a new feature you should [open an issue in the CLAW repository](https://github.com/Islandora-CLAW/CLAW/issues/new) or create a use case (see the _Use cases_ section above), and summarize the desired functionality. Prepend "Enhancement:" if creating an issue on the project repo, and "Use Case:" if creating a use case.
To request a new feature you should [open an issue in the Islandora 8 repository](https://github.com/Islandora/documentation/issues/new) or create a use case (see the _Use cases_ section above), and summarize the desired functionality. Prepend "Enhancement:" if creating an issue on the project repo, and "Use Case:" if creating a use case.

### Report a bug

To report a bug you should [open an issue in the CLAW repository](https://github.com/Islandora-CLAW/CLAW/issues/new) that summarizes the bug. Prepend the label "Bug:" to the title of the issue.
To report a bug you should [open an issue in the Islandora 8 repository](https://github.com/Islandora/documentation/issues/new) that summarizes the bug. Prepend the label "Bug:" to the title of the issue.

In order to help us understand and fix the bug it would be great if you could provide us with:

Expand All @@ -36,11 +36,11 @@ That is great! In this case please send us a pull request as described in the se

### Contribute code

Before you set out to contribute code you will need to have completed a [Contributor License Agreement](http://islandora.ca/sites/default/files/islandora_cla.pdf) or be covered by a [Corporate Contributor Licencse Agreement](http://islandora.ca/sites/default/files/islandora_ccla.pdf). The signed copy of the license agreement should be sent to <mailto:community@islandora.ca>
Before you set out to contribute code you will need to have completed a [Contributor License Agreement](http://islandora.ca/sites/default/files/islandora_cla.pdf) or be covered by a [Corporate Contributor License Agreement](http://islandora.ca/sites/default/files/islandora_ccla.pdf). The signed copy of the license agreement should be sent to <mailto:community@islandora.ca>

_If you are interested in contributing code to Islandora but do not know where to begin:_

In this case you should [browse open issues](https://github.com/Islandora-CLAW/CLAW/issues) and check out [use cases](https://github.com/Islandora-CLAW/CLAW/labels/use%20case).
In this case you should [browse open issues](https://github.com/Islandora/documentation/issues) and check out [use cases](https://github.com/Islandora/documentation/labels/use%20case).

If you are contributing Drupal code, it must adhere to [Drupal Coding Standards](https://www.drupal.org/coding-standards); Travis CI will check for this on pull requests.

Expand All @@ -49,7 +49,7 @@ Contributions to the Islandora codebase should be sent as GitHub pull requests.
* For _small patches_, feel free to submit pull requests directly for those patches.
* For _larger code contributions_, please use the following process. The idea behind this process is to prevent any wasted work and catch design issues early on.

1. [Open an issue](https://github.com/Islandora-CLAW/CLAW/issues), prepending "Enhancement:" in the title if a similar issue does not exist already. If a similar issue does exist, then you may consider participating in the work on the existing issue.
1. [Open an issue](https://github.com/Islandora/documentation/issues/new), prepending "Enhancement:" in the title if a similar issue does not exist already. If a similar issue does exist, then you may consider participating in the work on the existing issue.
2. Comment on the issue with your plan for implementing the issue. Explain what pieces of the codebase you are going to touch and how everything is going to fit together.
3. Islandora committers will work with you on the design to make sure you are on the right track.
4. Implement your issue, create a pull request (see below), and iterate from there.
Expand All @@ -60,7 +60,7 @@ Take a look at [Creating a pull request](https://help.github.com/articles/creati

1. [Fork](https://help.github.com/articles/fork-a-repo) this repository to your personal or institutional GitHub account (depending on the CLA you are working under). Be cautious of which branches you work from though (you'll want to base your work off master, or for Drupal modules use the most recent version branch). See [Fork a repo](https://help.github.com/articles/fork-a-repo) for detailed instructions.
2. Commit any changes to your fork.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) using the [pull request template](https://github.com/Islandora-CLAW/CLAW/blob/master/.github/PULL_REQUEST_TEMPLATE.md) to the Islandora GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/Islandora-CLAW/CLAW/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) using the [pull request template](https://github.com/Islandora/documentation/blob/master/.github/PULL_REQUEST_TEMPLATE.md) to the Islandora GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/Islandora/documentation/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.

You may want to read [Syncing a fork](https://help.github.com/articles/syncing-a-fork) for instructions on how to keep your fork up to date with the latest changes of the upstream (official) repository.

Expand Down
46 changes: 31 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# ![Syn](https://cloud.githubusercontent.com/assets/2371345/23724175/2998ecb0-0422-11e7-9009-aee3f129633f.png) Syn
[![Build Status](https://travis-ci.com/Islandora-CLAW/Syn.svg?branch=master)](https://travis-ci.com/Islandora-CLAW/Syn)
[![Build Status](https://travis-ci.com/Islandora/Syn.svg?branch=master)](https://travis-ci.com/Islandora/Syn)
[![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md)
[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](./LICENSE)
[![codecov](https://codecov.io/gh/Islandora-CLAW/Syn/branch/master/graph/badge.svg)](https://codecov.io/gh/Islandora-CLAW/Syn)
[![codecov](https://codecov.io/gh/Islandora/Syn/branch/master/graph/badge.svg)](https://codecov.io/gh/Islandora/Syn)

## Description
## Introduction

A valve for Tomcat8 that authenticates the JWT tokens created by Islandora in order to provide sessionless Authentication for Fedora4. Named after the Norse goddess [Syn](https://en.wikipedia.org/wiki/Syn_(goddess)).
A valve for Tomcat8 that authenticates the JWT tokens created by Islandora in order to provide sessionless Authentication for Fedora. Named after the Norse goddess [Syn](https://en.wikipedia.org/wiki/Syn_(goddess)).

## Building
## Requirements

This project requires Java 8 and can be built with [Gradle](https://gradle.org). To build and test locally, use `./gradlew build`.

## Installing
## Installation

### Copy Syn JAR
Copy the JAR that was built above from `build/libs/islandora-syn-X.X.X-all.jar` and place into `$TOMCAT_HOME/lib` directory. Can be found in Ubuntu at: `/var/lib/tomcat8/lib/`. Note that this JAR is built to contain all the dependancies.
Copy the JAR that was built above from `build/libs/islandora-syn-X.X.X-all.jar` and place into `$TOMCAT_HOME/lib` directory. Can be found in Ubuntu at: `/var/lib/tomcat8/lib/`. Note that this JAR is built to contain all the dependencies.

### Register Valve
Now register the valve in Tomcat configuration file.
Expand All @@ -29,8 +29,8 @@ In Ubuntu this file is located at: `/var/lib/tomcat8/conf/context.xml`
where:
* ***pathname***: The location of the settings file. Defaults to `$CATALINA_BASE/conf/syn-settings.xml`.

### Enable `security-contraint`
The valve checks if requested url is under **security contraints**. So, valve will activate only if the Fedora4 *web.xml* file contains something like:
### Enable `security-constraint`
The valve checks if requested URL is under **security constraints**. So, valve will activate only if the Fedora4 *web.xml* file contains something like:

```xml
<security-constraint>
Expand All @@ -54,7 +54,7 @@ The valve checks if requested url is under **security contraints**. So, valve wi
</login-config>
```

On ubuntu this file can be found at:
On Ubuntu this file can be found at:
`/var/lib/tomcat8/webapps/fcrepo/WEB-INF/web.xml`

### Setup Syn Configuration
Expand All @@ -63,16 +63,32 @@ Modify the [example configuration](./conf/syn-settings.example.xml) and move it
### Header principals
Additional roles are passed to Fedora via a HTTP header, this is configured via the `header` attribute to the `<config>` element in the syn-settings.xml.example file. You must also configure Fedora to read this header via its HeaderProvider.

## Documentation

Further documentation for this module is available on the [Islandora 8 documentation site](https://islandora.github.io/documentation/).

## Troubleshooting/Issues

Having problems or solved a problem? Check out the Islandora google groups for a solution.

* [Islandora Group](https://groups.google.com/forum/?hl=en&fromgroups#!forum/islandora)
* [Islandora Dev Group](https://groups.google.com/forum/?hl=en&fromgroups#!forum/islandora-dev)

## Maintainers

* [Jonathan Green](https://github.com/jonathangreen/)
Current maintainers:

* [Jared Whiklo](https://github.com/whikloj)


## Development

If you would like to contribute, please get involved by attending our weekly [Tech Call](https://github.com/Islandora-CLAW/CLAW/wiki). We love to hear from you!
If you would like to contribute, please get involved by attending our weekly [Tech Call](https://github.com/islandora/documentation/wiki). We love to hear from you!

If you would like to contribute code to the project, you need to be covered by an Islandora Foundation [Contributor License Agreement](http://islandora.ca/sites/default/files/islandora_cla.pdf) or [Corporate Contributor License Agreement](http://islandora.ca/sites/default/files/islandora_ccla.pdf). Please see the [Contributors](http://islandora.ca/resources/contributors) pages on Islandora.ca for more information.

If you would like to contribute code to the project, you need to be covered by an Islandora Foundation [Contributor License Agreement](http://islandora.ca/sites/default/files/islandora_cla.pdf) or [Corporate Contributor Licencse Agreement](http://islandora.ca/sites/default/files/islandora_ccla.pdf). Please see the [Contributors](http://islandora.ca/resources/contributors) pages on Islandora.ca for more information.
We recommend using the [islandora-playbook](https://github.com/Islandora-Devops/islandora-playbook) to get started.

## Licensing
## License

MIT
[MIT](/LICENSE.txt)
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apply plugin: 'jacoco'
apply plugin: 'com.github.johnrengelman.shadow'

def projectName = 'islandora-syn'
def projectVersion = '1.0.0'
def projectVersion = '1.0.1-SNAPSHOT'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -20,7 +20,7 @@ checkstyle {
}

repositories {
maven { url "http://repo.maven.apache.org/maven2" }
maven { url "https://repo.maven.apache.org/maven2" }
}

dependencies {
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/ca/islandora/syn/settings/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
public class Config {
private int version = -1;
private String header = "";
private boolean disabled = false;
private final List<Site> sites = new ArrayList<>();
private final List<Token> tokens = new ArrayList<>();

Expand Down Expand Up @@ -37,4 +38,12 @@ public void setHeader(final String header) {
public String getHeader() {
return this.header;
}

public void setDisabled(final String disabled) {
this.disabled = Boolean.parseBoolean(disabled);
}

public boolean getDisabled() {
return this.disabled;
}
}
4 changes: 3 additions & 1 deletion src/main/java/ca/islandora/syn/valve/SynValve.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class SynValve extends ValveBase {
private Map<String, Token> staticTokenMap = null;
private Map<String, Boolean> anonymousGetMap = null;
private String roleHeader = null;
private boolean isDisabled = false;

@Override
public void invoke(final Request request, final Response response)
Expand All @@ -54,7 +55,7 @@ public void invoke(final Request request, final Response response)
final SecurityConstraint[] constraints = this.container.getRealm()
.findSecurityConstraints(request, request.getContext());

if ((constraints == null
if (this.isDisabled || (constraints == null
&& !request.getContext().getPreemptiveAuthentication())
|| !hasAuthConstraint(constraints)) {
this.getNext().invoke(request, response);
Expand Down Expand Up @@ -301,6 +302,7 @@ public synchronized void startInternal() throws LifecycleException {
this.staticTokenMap = SettingsParser.getSiteStaticTokens(sites);
this.anonymousGetMap = SettingsParser.getSiteAllowAnonymous(sites);
this.roleHeader = sites.getHeader();
this.isDisabled = sites.getDisabled();
} catch (final Exception e) {
throw new LifecycleException("Error parsing XML Configuration", e);
}
Expand Down
Loading

0 comments on commit fc075f5

Please sign in to comment.