public
Description: restful workflow engine based on Rack and ruote (Warning : ruote-rest will be replaced by ruote-kit soon)
Homepage: http://openwferu.rubyforge.org
Clone URL: git://github.com/jmettraux/ruote-rest.git
jmettraux (author)
Mon Nov 02 21:55:41 -0800 2009
commit  1a56bd3fb72150f14e2f3fef6c90a306217bca0b
tree    d56ec76162bed4887ce3d818e4ec9dc419b411d1
parent  b9888dc0b8f2c30292704de67514edb0a2501813
ruote-rest / README.newauth
100644 139 lines (106 sloc) 4.077 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
 
 
** Note : most of this documentation got integrated into README.txt
   Thanks to Gonzalo and Nando for all their work ! **
 
 
This is a draft for a new authentication model in ruote-rest.
 
authors: Gonzalo <gonzalo@abstra.cc>
         "Nando Sola"<nando@abstra.cc>
 
Our main goal was to avoid storing passwords in plain text (conf/authentication.yaml)
All authentication info is stored in "ruoterest_#{stage}" - The following tables are created
 
USERS (inspired by ruote-web2)
+------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| login | varchar(255) | YES | UNI | NULL | |
| name | varchar(255) | YES | MUL | NULL | |
| password | varchar(255) | YES | | NULL | |
| email | varchar(255) | YES | MUL | NULL | |
| created_at | datetime | YES | MUL | NULL | |
| updated_at | datetime | YES | MUL | NULL | |
+------------+--------------+------+-----+---------+----------------+
 
HOSTS (IP whitelisting and ToD filter)
+---------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| ip | varchar(255) | YES | | NULL | |
| trusted | varchar(255) | YES | | NULL | |
| from | varchar(255) | YES | | NULL | |
| to | varchar(255) | YES | | NULL | |
+---------+--------------+------+-----+---------+----------------+
 
Passwords
---------
So far, we've successfully implemented the following password storage schemes:
 
  * {SSHA}
  * {SMD5}
  * {...} It's easily extensible
 
An 8-byte salt is included in the b64 passwd string (a la Directory Server)
 
 
Hosts table:
------------
attributes:
* 'ip': as for now, every host making requests to ruote-rest must be stored in this table.
* 'trusted': 'false' or 'true' for whitelist inclussion, thus disabling ToD and user/passwd checks.
* 'from' - 'to': Time of Day filter. Set a valid interval to use ruote-rest or NULL.
 
Included files:
---------------
./newauth-ruoterest
  +tasks
    authmodel.rake
    +fixtures
      users.yml
      hosts.yml
  +test
    test_newauth.rb
  README
  +conf
    auth_models.rb
    password.rb
    auth.rb
 
Usage:
------
git clone git://github.com/jmettraux/ruote-rest.git
cp newauth.tar ruote-rest; tar xvf newauth.tar
 
edit Rakefile:
     50 load 'tasks/ruote.rake'
     51 load 'tasks/mysql.rake'
---> 52 load 'tasks/authmodel.rake'
 
edit tasks/fixtures/hosts.yaml and make sure everything looks OK
 
gem install rest-client in order to run our tests
rake ruote:install
 
edit conf/database.yaml and tasks/mysql.rake and make the appropriate changes to db_name, :user and :passwd
 
rake mysql:setup; rake authmodel:setup; rake authmodel:fixtures
 
Now lets rock!
ruby lib/start.rb & or daemonize
 
Now we can roll the unit tests:
cd test
ruby test_newauth.rb - they aren't complete yet, but the main features are tested.
 
Test users:
-----------
username: charly, bob, admin, alice
password: secret
 
Test hosts:
-----------
 
st_01:
    id: 1
    ip: "192.168.168.1"
    trusted: false
    from: 9
    to: 17
 
host_02:
    id: 2
    ip: "192.168.168.128"
    trusted: false
    from: NULL
    to: NULL
 
host_03:
    id: 3
    ip: "127.0.0.1"
    trusted: true
    from: NULL
    to: NULL
 
******
Feel free to play with them, i.e. adding/deleting/modifying on the fly.
If you wanna use a real REST client from a remote host, try: http://code.google.com/p/rest-client/
 
******
Post any suggestions/corrections at the list
 
    http://groups.google.com/group/openwferu-users
 
Thanks John for this great project