Skip to content

Commit

Permalink
annotated all classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Miro Zurbuchen committed May 30, 2017
1 parent e8f0f8c commit 229a7f5
Show file tree
Hide file tree
Showing 25 changed files with 276 additions and 4 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -31,6 +31,7 @@ gem 'therubyracer'
gem 'turbolinks'
gem 'twitter-bootstrap-rails', '~>3.2'
gem 'uglifier'
gem 'annotate'


group :development, :test do
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Expand Up @@ -44,6 +44,9 @@ GEM
airbrake (4.3.8)
builder
multi_json
annotate (2.6.5)
activerecord (>= 2.3.0)
rake (>= 0.8.7)
arel (6.0.4)
ast (2.3.0)
binding_of_caller (0.7.2)
Expand Down Expand Up @@ -303,6 +306,7 @@ PLATFORMS
DEPENDENCIES
active_model_serializers (= 0.10.0)
airbrake (< 5.0)
annotate
bootstrap-select-rails
brakeman
breadcrumbs_on_rails
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Expand Up @@ -12,6 +12,8 @@ unless Rails.env.production?
RuboCop::RakeTask.new
end

Annotate.load_tasks

Rake::TestTask.new(:test) do |t|
t.libs << ['lib', 'test']
t.test_files = Dir['test/**/*_test.rb'].reject do |path|
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/logins_controller.rb
Expand Up @@ -90,7 +90,7 @@ def create_session(user, password)
begin
set_session_attributes(user, password)
user.update_info
user.update_last_login_ip(request.remote_ip)
user.set_last_login_ip(request.remote_ip)
CryptUtils.validate_keypair(session[:private_key], user.public_key)
rescue Exceptions::DecryptFailed
return false
Expand Down
14 changes: 14 additions & 0 deletions app/models/account.rb
@@ -1,4 +1,18 @@
# encoding: utf-8
# == Schema Information
#
# Table name: accounts
#
# id :integer not null, primary key
# accountname :string(70) default(""), not null
# group_id :integer default("0"), not null
# description :text
# username :binary
# password :binary
# created_at :datetime not null
# updated_at :datetime not null
#


# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
12 changes: 12 additions & 0 deletions app/models/group.rb
@@ -1,4 +1,16 @@
# encoding: utf-8
# == Schema Information
#
# Table name: groups
#
# id :integer not null, primary key
# name :string(40) default(""), not null
# description :text
# created_at :datetime not null
# updated_at :datetime not null
# team_id :integer default("0"), not null
#


# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
14 changes: 14 additions & 0 deletions app/models/item.rb
@@ -1,4 +1,18 @@
# encoding: utf-8
# == Schema Information
#
# Table name: items
#
# id :integer not null, primary key
# account_id :integer default("0"), not null
# description :text
# file :binary
# created_at :datetime not null
# updated_at :datetime not null
# filename :text not null
# content_type :text not null
#


# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
13 changes: 13 additions & 0 deletions app/models/log.rb
@@ -1,4 +1,17 @@
# encoding: utf-8
# == Schema Information
#
# Table name: logs
#
# id :integer not null, primary key
# output :string
# status :string
# log_type :string
# executer_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#


# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
8 changes: 8 additions & 0 deletions app/models/recryptrequest.rb
@@ -1,4 +1,12 @@
# encoding: utf-8
# == Schema Information
#
# Table name: recryptrequests
#
# id :integer not null, primary key
# user_id :integer default("0"), not null
#


# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
10 changes: 10 additions & 0 deletions app/models/setting.rb
@@ -1,4 +1,14 @@
# encoding: utf-8
# == Schema Information
#
# Table name: settings
#
# id :integer not null, primary key
# key :string not null
# value :string
# type :string not null
#


# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
10 changes: 10 additions & 0 deletions app/models/setting/country_code.rb
@@ -1,4 +1,14 @@
# encoding: utf-8
# == Schema Information
#
# Table name: settings
#
# id :integer not null, primary key
# key :string not null
# value :string
# type :string not null
#


# Copyright (c) 2008-2017, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
10 changes: 10 additions & 0 deletions app/models/setting/ip_range.rb
@@ -1,4 +1,14 @@
# encoding: utf-8
# == Schema Information
#
# Table name: settings
#
# id :integer not null, primary key
# key :string not null
# value :string
# type :string not null
#


# Copyright (c) 2008-2017, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
10 changes: 10 additions & 0 deletions app/models/setting/number.rb
@@ -1,4 +1,14 @@
# encoding: utf-8
# == Schema Information
#
# Table name: settings
#
# id :integer not null, primary key
# key :string not null
# value :string
# type :string not null
#


# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
10 changes: 10 additions & 0 deletions app/models/setting/text.rb
@@ -1,4 +1,14 @@
# encoding: utf-8
# == Schema Information
#
# Table name: settings
#
# id :integer not null, primary key
# key :string not null
# value :string
# type :string not null
#


# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
10 changes: 10 additions & 0 deletions app/models/setting/true_false.rb
@@ -1,4 +1,14 @@
# encoding: utf-8
# == Schema Information
#
# Table name: settings
#
# id :integer not null, primary key
# key :string not null
# value :string
# type :string not null
#


# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
13 changes: 13 additions & 0 deletions app/models/team.rb
@@ -1,4 +1,17 @@
# encoding: utf-8
# == Schema Information
#
# Table name: teams
#
# id :integer not null, primary key
# name :string(40) default(""), not null
# description :text
# created_at :datetime not null
# updated_at :datetime not null
# visible :boolean default("t"), not null
# private :boolean default("f"), not null
#


# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
12 changes: 12 additions & 0 deletions app/models/teammember.rb
@@ -1,4 +1,16 @@
# encoding: utf-8
# == Schema Information
#
# Table name: teammembers
#
# id :integer not null, primary key
# team_id :integer default("0"), not null
# password :binary not null
# user_id :integer default("0"), not null
# created_at :datetime not null
# updated_at :datetime not null
#


# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
24 changes: 23 additions & 1 deletion app/models/user.rb
@@ -1,4 +1,26 @@
# encoding: utf-8
# == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# public_key :text not null
# private_key :binary not null
# password :binary
# admin :boolean default("f"), not null
# uid :integer
# last_login_at :datetime
# username :string
# givenname :string
# surname :string
# auth :string default("db"), not null
# preferred_locale :string default("en"), not null
# locked :boolean default("f")
# last_failed_login_attempt_at :datetime
# failed_login_attempts :integer default("0"), not null
# last_login_from :string
#


# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down Expand Up @@ -100,7 +122,7 @@ def update_info
update_attribute(:last_login_at, Time.zone.now)
end

def update_last_login_ip(last_login_ip)
def set_last_login_ip(last_login_ip)
update_attribute(:last_login_from, last_login_ip)
end

Expand Down
14 changes: 14 additions & 0 deletions test/fixtures/accounts.yml
@@ -1,3 +1,17 @@
# == Schema Information
#
# Table name: accounts
#
# id :integer not null, primary key
# accountname :string(70) default(""), not null
# group_id :integer default("0"), not null
# description :text
# username :binary
# password :binary
# created_at :datetime not null
# updated_at :datetime not null
#

# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
# See the COPYING file at the top-level directory or at
Expand Down
14 changes: 13 additions & 1 deletion test/fixtures/groups.yml
@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: groups
#
# id :integer not null, primary key
# name :string(40) default(""), not null
# description :text
# created_at :datetime not null
# updated_at :datetime not null
# team_id :integer default("0"), not null
#

# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
# See the COPYING file at the top-level directory or at
Expand All @@ -9,4 +21,4 @@ group1:

group2:
name: group2
team: team2
team: team2
16 changes: 15 additions & 1 deletion test/fixtures/items.yml
@@ -1,9 +1,23 @@
# encoding: utf-8
# == Schema Information
#
# Table name: items
#
# id :integer not null, primary key
# account_id :integer default("0"), not null
# description :text
# file :binary
# created_at :datetime not null
# updated_at :datetime not null
# filename :text not null
# content_type :text not null
#

# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
# See the COPYING file at the top-level directory or at
# https://github.com/puzzle/cryptopus.

# encoding: utf-8

# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
Expand Down
10 changes: 10 additions & 0 deletions test/fixtures/settings.yml
@@ -1,3 +1,13 @@
# == Schema Information
#
# Table name: settings
#
# id :integer not null, primary key
# key :string not null
# value :string
# type :string not null
#

# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
# See the COPYING file at the top-level directory or at
Expand Down
12 changes: 12 additions & 0 deletions test/fixtures/teammembers.yml
@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: teammembers
#
# id :integer not null, primary key
# team_id :integer default("0"), not null
# password :binary not null
# user_id :integer default("0"), not null
# created_at :datetime not null
# updated_at :datetime not null
#

# Copyright (c) 2008-2016, Puzzle ITC GmbH. This file is part of
# Cryptopus and licensed under the Affero General Public License version 3 or later.
# See the COPYING file at the top-level directory or at
Expand Down

0 comments on commit 229a7f5

Please sign in to comment.