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

Refactoring and enhancements #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.gem
*.rbc
log
.bundle
.config
.yardoc
Expand All @@ -16,3 +17,4 @@ test/tmp
test/version_tmp
tmp
*.DS_Store
*.db
1 change: 0 additions & 1 deletion .ruby-gemset

This file was deleted.

1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ end
group :test do
gem 'rake'
gem 'rspec'
gem 'rubycas-server-memory', github: 'vasilakisfil/rubycas-server-memory'
end
51 changes: 49 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,60 @@
rubycas-server-core
===================
[![Build Status](https://travis-ci.org/rubycas/rubycas-server-core.png)](https://travis-ci.org/rubycas/rubycas-server-core)
The core logic for handling CAS requests independent of any particular storage or web presentation technology.
[![Circle CI](https://circleci.com/gh/vasilakisfil/rubycas-server-core.svg?style=svg)](https://circleci.com/gh/vasilakisfil/rubycas-server-core)

The core logic for handling CAS requests independent of any particular storage or web presentation technology.

## Requirements

* ruby 2.1.x

## Adapters
Currently available adapters are:
* [rubycas-server-activerecord](https://github.com/kollegorna/rubycas-server-activerecord)
* [rubycas-server-memory](https://github.com/vasilakisfil/rubycas-server-memory)

If you want to create a new adapter check these 2 adapters how they are implemented. Essentially you need to implement the following methods for each ticket:

```ruby

class XXXTicket
def initialize(options = {})
end

#deprecated
def self.find_by_ticket(ticket)
#returns the ticket based on the ticket id
#it will be removed soon
end

def self.find_by(opts = {})
#returns the ticket based on the constraints in the hash (activerecord-style)
end

def save!
#saves the ticket in the storage
#throws an exception in case of an error
end

def save
#saves the ticket in the storage
end

def consumed?
#returns true if ticket is already consumed
end

def consume!
#consumes the ticket
end

def expired?(max_lifetime = 100)
#checks if the ticket is already expired
end

end
```

## Contributing

1. Fork it
Expand Down
3 changes: 3 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
machine:
ruby:
version: 2.1.2
4 changes: 3 additions & 1 deletion lib/rubycas-server-core.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
require "logger"
require "r18n-core"
require "rubycas-server-core/version"
require "rubycas-server-core/error"
require "rubycas-server-core/authenticator"
require "rubycas-server-core/settings"
require "rubycas-server-core/database"
require "rubycas-server-core/util"
require "rubycas-server-core/tickets"
require "rubycas-server-core/tickets/generations"
require "rubycas-server-core/tickets/validations"
require "rubycas-server-core/tickets"

module RubyCAS
module Server
Expand Down
21 changes: 0 additions & 21 deletions lib/rubycas-server-core/adapters/in_memory.rb

This file was deleted.

45 changes: 0 additions & 45 deletions lib/rubycas-server-core/adapters/in_memory/login_ticket.rb

This file was deleted.

This file was deleted.

50 changes: 0 additions & 50 deletions lib/rubycas-server-core/adapters/in_memory/proxy_ticket.rb

This file was deleted.

56 changes: 0 additions & 56 deletions lib/rubycas-server-core/adapters/in_memory/service_ticket.rb

This file was deleted.

23 changes: 0 additions & 23 deletions lib/rubycas-server-core/adapters/in_memory/storage.rb

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion lib/rubycas-server-core/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Core
module Database
extend self
def setup(config_file)
raise NotImplementedError, "Database adapter is missing, add it to your Gemfile, please refer to https://github.com/rubycas/rubycas-server-core/wiki for more details"
#raise NotImplementedError, "Database adapter is missing, add it to your Gemfile, please refer to https://github.com/rubycas/rubycas-server-core/wiki for more details"
end
end
end
Expand Down
Loading