Skip to content

Commit

Permalink
Specifying default username/password for Fedora
Browse files Browse the repository at this point in the history
  • Loading branch information
escowles committed Dec 5, 2018
1 parent b51990d commit bcf20f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,9 @@ By default, it is assumed that a Valkyrie repository implementation shall use a
* The test stack cleans up after itself on exit.

## Fedora 5 Compatibility
When running tests:
* Specify a Fedora 5 release when running test servers:
When configuring your adapter, include the `fedora_version` parameter in your metadata or storage adapter config. If Fedora requires auth, you can also include that in the URL, e.g.:
```
FCREPO_VERSION=5.0.0-RC-1 rake server:test
```
* Enable Fedora 5 compatibility when running tests:
```
FEDORA5_COMPAT=true rspec
```
When configuring your adapter:
* Include the `fedora_version` paramter in your metadata or storage adapter config, e.g.:
```
Valkyrie::Storage::Fedora.new(connection: Ldp::Client.new("http://localhost:8988/rest"), fedora_version: 5)
Valkyrie::Storage::Fedora.new(connection: Ldp::Client.new("http://fedoraAdmin:fedoraAdmin@localhost:8988/rest"), fedora_version: 5)
```

The development and test stacks use fully contained virtual volumes and bind all services to different ports, so they can be running at the same time without issue.
Expand Down
6 changes: 5 additions & 1 deletion spec/support/fedora_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ def fedora_adapter_config(base_path:, schema: nil, fedora_version: 4)
port = fedora_version == 4 ? 8988 : 8998
opts = {
base_path: base_path,
connection: ::Ldp::Client.new("http://localhost:#{port}/rest"),
connection: ::Ldp::Client.new("http://#{fedora_auth}localhost:#{port}/rest"),
fedora_version: fedora_version
}
opts[:schema] = schema if schema
opts
end

def fedora_auth
"fedoraAdmin:fedoraAdmin@"
end

def wipe_fedora!(base_path:, fedora_version: 4)
Valkyrie::Persistence::Fedora::MetadataAdapter.new(fedora_adapter_config(base_path: base_path, fedora_version: fedora_version)).persister.wipe!
end
Expand Down

0 comments on commit bcf20f1

Please sign in to comment.