martinet 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.milestonerrc +12 -0
- data/.travis.yml +2 -0
- data/CHANGELOG.md +3 -0
- data/CODE_OF_CONDUCT.md +53 -41
- data/CONTRIBUTING.md +35 -0
- data/Gemfile +4 -0
- data/{LICENSE.txt → LICENSE.md} +0 -0
- data/README.md +52 -26
- data/Rakefile +5 -0
- data/bin/setup +8 -0
- data/lib/martinet/configuration.rb +1 -1
- data/lib/martinet/impersonation.rb +6 -0
- data/lib/martinet/session.rb +0 -5
- data/lib/martinet/version.rb +1 -1
- data/lib/martinet.rb +2 -1
- data/martinet.gemspec +9 -9
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 117c44e299449f6464a1ebceb6aeb081fb6565d6
|
4
|
+
data.tar.gz: 550da0e0724e738801bccbc3e97a72bdf4dac8c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d57017541c8ac0415ce874e2a5c3d73e06b8aa20b68efb69a0b99fad0e074158a52c10987c33253fa74dffb72641fa7a0bdf120bece38d42f407ab7a0051610
|
7
|
+
data.tar.gz: f4eae9e19800dec40300e141a86dfe1d4e6630fc6b959d71982e2e5e27f1fc3d6e53afdcd075670097453ecf906807942e5e04e95dfc2eb364e20c2988871f03
|
data/.milestonerrc
ADDED
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,49 +1,61 @@
|
|
1
|
-
# Contributor Code of Conduct
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
2
|
|
3
|
-
|
4
|
-
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
-
contribute through reporting issues, posting feature requests, updating
|
6
|
-
documentation, submitting pull requests or patches, and other activities.
|
3
|
+
## Our Pledge
|
7
4
|
|
8
|
-
|
9
|
-
experience for everyone, regardless of
|
10
|
-
identity and expression,
|
11
|
-
|
5
|
+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making
|
6
|
+
participation in our project and our community a harassment-free experience for everyone, regardless of age, body size,
|
7
|
+
disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race,
|
8
|
+
religion, or sexual identity and orientation.
|
9
|
+
|
10
|
+
## Our Standards
|
11
|
+
|
12
|
+
Examples of behavior that contributes to creating a positive environment include:
|
13
|
+
|
14
|
+
* Using welcoming and inclusive language
|
15
|
+
* Being respectful of differing viewpoints and experiences
|
16
|
+
* Gracefully accepting constructive criticism
|
17
|
+
* Focusing on what is best for the community
|
18
|
+
* Showing empathy towards other community members
|
12
19
|
|
13
20
|
Examples of unacceptable behavior by participants include:
|
14
21
|
|
15
|
-
* The use of sexualized language or imagery
|
16
|
-
*
|
17
|
-
* Trolling or insulting/derogatory comments
|
22
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
23
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
18
24
|
* Public or private harassment
|
19
|
-
* Publishing
|
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
|
-
|
25
|
+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
26
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
27
|
+
|
28
|
+
## Our Responsibilities
|
29
|
+
|
30
|
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take
|
31
|
+
appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
32
|
+
|
33
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
|
34
|
+
issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
|
35
|
+
contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
36
|
+
|
37
|
+
## Scope
|
38
|
+
|
39
|
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the
|
40
|
+
project or its community. Examples of representing a project or community include using an official project e-mail
|
41
|
+
address, posting via an official social media account, or acting as an appointed representative at an online or offline
|
42
|
+
event. Representation of a project may be further defined and clarified by project maintainers.
|
43
|
+
|
44
|
+
## Enforcement
|
45
|
+
|
46
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
|
47
|
+
[tangrufus@gmail.com](mailto:tangrufus@gmail.com). All complaints will be reviewed and
|
48
|
+
investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project
|
49
|
+
team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific
|
50
|
+
enforcement policies may be posted separately.
|
51
|
+
|
52
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent
|
53
|
+
repercussions as determined by other members of the project's leadership.
|
54
|
+
|
55
|
+
## Attribution
|
56
|
+
|
57
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
58
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
47
59
|
|
48
60
|
[homepage]: http://contributor-covenant.org
|
49
|
-
[version]: http://contributor-covenant.org/version/1/
|
61
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Overview
|
2
|
+
|
3
|
+
Thanks for taking an interest in this open source project. Your support and involvement is greatly appreciated. The
|
4
|
+
following details what you need to know in order to contribute.
|
5
|
+
|
6
|
+
# Requirements
|
7
|
+
|
8
|
+
- Follow these [Basic Programming Styles](https://github.com/bkuhlmann/style_guides/blob/master/programming/basic.md).
|
9
|
+
- Follow these [Code Review Styles](https://github.com/bkuhlmann/style_guides/blob/master/programming/code_reviews.md).
|
10
|
+
- Follow these [Git Styles](https://github.com/bkuhlmann/style_guides/blob/master/programming/git.md).
|
11
|
+
- Follow these [Bash Styles](https://github.com/bkuhlmann/style_guides/blob/master/programming/languages/bash.md).
|
12
|
+
- Follow these [CSS Styles](https://github.com/bkuhlmann/style_guides/blob/master/programming/languages/css.md).
|
13
|
+
- Follow these [Ruby Styles](https://github.com/bkuhlmann/style_guides/blob/master/programming/languages/ruby/ruby.md).
|
14
|
+
|
15
|
+
# Contributing Code
|
16
|
+
|
17
|
+
0. Read the project README thoroughly before starting.
|
18
|
+
0. Fork the master branch of the repository.
|
19
|
+
0. Ensure there are no setup, usage, and/or test issues (again, follow the README).
|
20
|
+
0. Add tests for new functionality (refactoring and documentation changes can be excluded).
|
21
|
+
0. Ensure all tests pass.
|
22
|
+
0. Push your feature branch and submit a pull request.
|
23
|
+
|
24
|
+
# Submitting Issues
|
25
|
+
|
26
|
+
0. Submit an issue via the GitHub Issues tab (assuming one does not already exist).
|
27
|
+
0. Clearly describe the issue (including steps to reproduce).
|
28
|
+
0. Specify your enviroment setup (OS, browser, language, etc. with version info).
|
29
|
+
0. Provide a stack dump (if possible).
|
30
|
+
0. Explain any additional details that might help diagnose the problem quickly.
|
31
|
+
|
32
|
+
# Feedback
|
33
|
+
|
34
|
+
Expect a response within one to three business days.
|
35
|
+
Changes, alternatives, and/or improvements might be suggested upon review.
|
data/Gemfile
CHANGED
data/{LICENSE.txt → LICENSE.md}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# martinet
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/martinet.svg)](https://badge.fury.io/rb/martinet)
|
4
4
|
[![Gem](https://img.shields.io/gem/dt/martinet.svg?maxAge=2592000)](https://rubygems.org/gems/martinet)
|
@@ -9,54 +9,80 @@
|
|
9
9
|
[![GitHub issues](https://img.shields.io/github/issues/TangRufus/martinet.svg)](https://github.com/TangRufus/martinet/issues)
|
10
10
|
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/TangRufus/martinet/master/LICENSE.txt)
|
11
11
|
|
12
|
+
<!-- Tocer[start]: Auto-generated, don't remove. -->
|
12
13
|
|
14
|
+
# Table of Contents
|
13
15
|
|
16
|
+
- [Features](#features)
|
17
|
+
- [Screencasts](#screencasts)
|
18
|
+
- [Requirements](#requirements)
|
19
|
+
- [Setup](#setup)
|
20
|
+
- [Usage](#usage)
|
21
|
+
- [Versioning](#versioning)
|
22
|
+
- [Code of Conduct](#code-of-conduct)
|
23
|
+
- [Contributions](#contributions)
|
24
|
+
- [License](#license)
|
25
|
+
- [History](#history)
|
26
|
+
- [Credits](#credits)
|
14
27
|
|
15
|
-
|
28
|
+
<!-- Tocer[finish]: Auto-generated, don't remove. -->
|
16
29
|
|
17
|
-
|
30
|
+
# Features
|
18
31
|
|
19
|
-
|
32
|
+
# Screencasts
|
20
33
|
|
21
|
-
|
34
|
+
# Requirements
|
22
35
|
|
23
|
-
|
36
|
+
0. [MRI 2.3.0](https://www.ruby-lang.org)
|
24
37
|
|
25
|
-
|
38
|
+
# Setup
|
26
39
|
|
27
|
-
|
40
|
+
For a secure install, type the following (recommended):
|
28
41
|
|
29
|
-
|
42
|
+
gem cert --add <(curl --location --silent /gem-public.pem)
|
43
|
+
gem install martinet --trust-policy MediumSecurity
|
30
44
|
|
31
|
-
|
45
|
+
NOTE: A HighSecurity trust policy would be best but MediumSecurity enables signed gem verification while
|
46
|
+
allowing the installation of unsigned dependencies since they are beyond the scope of this gem.
|
32
47
|
|
33
|
-
|
48
|
+
For an insecure install, type the following (not recommended):
|
34
49
|
|
35
|
-
|
50
|
+
gem install martinet
|
36
51
|
|
37
|
-
|
38
|
-
gem 'martinet'
|
39
|
-
```
|
52
|
+
Add the following to your Gemfile:
|
40
53
|
|
41
|
-
|
54
|
+
gem "martinet"
|
42
55
|
|
43
|
-
|
56
|
+
# Usage
|
44
57
|
|
45
|
-
Or install it yourself as:
|
46
58
|
|
47
|
-
|
59
|
+
# Versioning
|
48
60
|
|
49
|
-
|
61
|
+
Read [Semantic Versioning](http://semver.org) for details. Briefly, it means:
|
50
62
|
|
51
|
-
|
63
|
+
- Patch (x.y.Z) - Incremented for small, backwards compatible bug fixes.
|
64
|
+
- Minor (x.Y.z) - Incremented for new, backwards compatible public API enhancements and/or bug fixes.
|
65
|
+
- Major (X.y.z) - Incremented for any backwards incompatible public API changes.
|
52
66
|
|
53
|
-
|
67
|
+
# Code of Conduct
|
54
68
|
|
55
|
-
|
69
|
+
Please note that this project is released with a [CODE OF CONDUCT](CODE_OF_CONDUCT.md). By participating in this project
|
70
|
+
you agree to abide by its terms.
|
56
71
|
|
57
|
-
|
72
|
+
# Contributions
|
58
73
|
|
74
|
+
Read [CONTRIBUTING](CONTRIBUTING.md) for details.
|
59
75
|
|
60
|
-
|
76
|
+
# License
|
61
77
|
|
62
|
-
|
78
|
+
Copyright (c) 2016 []().
|
79
|
+
Read the [LICENSE](LICENSE.md) for details.
|
80
|
+
|
81
|
+
# History
|
82
|
+
|
83
|
+
Read the [CHANGELOG](CHANGELOG.md) for details.
|
84
|
+
Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
|
85
|
+
|
86
|
+
# Credits
|
87
|
+
|
88
|
+
Developed by [Tang Rufus](https://www.github.com/tangrufus) at []().
|
data/Rakefile
CHANGED
data/bin/setup
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
#! /bin/bash
|
2
|
+
|
3
|
+
set -o nounset # Exit, with error message, when attempting to use an undefined variable.
|
4
|
+
set -o errexit # Abort script at first error, when a command exits with non-zero status.
|
5
|
+
set -o pipefail # Return exit status of the last command in the pipe that returned a non-zero return value.
|
6
|
+
IFS=$'\n\t' # Defines newlines and tabs as delimiters for splitting words and iterating arrays.
|
7
|
+
|
8
|
+
bundle install
|
data/lib/martinet/session.rb
CHANGED
@@ -2,11 +2,6 @@ module Martinet
|
|
2
2
|
# HTTP/Warden session-specific behavior.
|
3
3
|
class Session
|
4
4
|
def initialize(warden)
|
5
|
-
# TODO: Move this to Martinet::Impersonation class
|
6
|
-
if Martinet.configuration.enable_impersonation
|
7
|
-
class << self; include Impersonation; end
|
8
|
-
end
|
9
|
-
|
10
5
|
@warden = warden
|
11
6
|
end
|
12
7
|
|
data/lib/martinet/version.rb
CHANGED
data/lib/martinet.rb
CHANGED
data/martinet.gemspec
CHANGED
@@ -4,15 +4,15 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'martinet/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name
|
8
|
-
spec.version
|
9
|
-
spec.
|
10
|
-
spec.
|
11
|
-
|
12
|
-
spec.
|
13
|
-
spec.
|
14
|
-
spec.
|
15
|
-
spec.license
|
7
|
+
spec.name = 'martinet'
|
8
|
+
spec.version = Martinet::VERSION
|
9
|
+
spec.platform = Gem::Platform::RUBY
|
10
|
+
spec.authors = ['Tang Rufus']
|
11
|
+
spec.email = ['tangrufus@gmail.com']
|
12
|
+
spec.homepage = 'https://github.com/TangRufus/martinet'
|
13
|
+
spec.summary = 'Authorization component for warden'
|
14
|
+
spec.description = 'Authorization component for warden'
|
15
|
+
spec.license = 'MIT'
|
16
16
|
|
17
17
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
18
18
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: martinet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tang Rufus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: warden
|
@@ -114,13 +114,17 @@ files:
|
|
114
114
|
- ".codeclimate.yml"
|
115
115
|
- ".gitignore"
|
116
116
|
- ".hound.yml"
|
117
|
+
- ".milestonerrc"
|
117
118
|
- ".rubocop.yml"
|
118
119
|
- ".travis.yml"
|
120
|
+
- CHANGELOG.md
|
119
121
|
- CODE_OF_CONDUCT.md
|
122
|
+
- CONTRIBUTING.md
|
120
123
|
- Gemfile
|
121
|
-
- LICENSE.
|
124
|
+
- LICENSE.md
|
122
125
|
- README.md
|
123
126
|
- Rakefile
|
127
|
+
- bin/setup
|
124
128
|
- lib/martinet.rb
|
125
129
|
- lib/martinet/configuration.rb
|
126
130
|
- lib/martinet/impersonation.rb
|