kiji 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/CODEOWNERS +37 -0
- data/.github/workflows/test.yml +37 -0
- data/.gitignore +1 -2
- data/.rubocop.yml +6 -3
- data/.rubocop_todo.yml +1 -5
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +137 -0
- data/LICENSE.md +2 -2
- data/README.md +26 -27
- data/bin/console +0 -0
- data/gemfiles/faraday_0.gemfile +5 -0
- data/gemfiles/faraday_1.gemfile +5 -0
- data/gemfiles/faraday_2.gemfile +5 -0
- data/{egov.gemspec → kiji.gemspec} +9 -11
- data/lib/kiji/access.rb +46 -49
- data/lib/kiji/authentication.rb +20 -20
- data/lib/kiji/client.rb +11 -3
- data/lib/kiji/digester.rb +2 -2
- data/lib/kiji/signer.rb +19 -19
- data/lib/kiji/version.rb +1 -1
- data/lib/kiji/zipper.rb +4 -4
- metadata +38 -46
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 4c8a8b5d4069b73cf1f2dd6f9f516bddb149c5e9cbe47d46a14ff58b04cd27d2
|
|
4
|
+
data.tar.gz: 26e67439c75bd954d25c70498023b93d61bb521467c1b3e75277f40206dfc414
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba6fd917dc19859f9dc904df4919a7f1d1e75a62648651be815c67a2f036131c364aa348458d605858e7611f394e4e447f65426b5ef461192311b120526277e6
|
|
7
|
+
data.tar.gz: 228706cc11c338a6515c25de6f011bbfa98079b4b3d587b74129d50db32732c73285fb8a995dd9803b4274920f1d2bfe321f4ceb09888f7d267d92f34b94b83e
|
data/.github/CODEOWNERS
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# This is a comment.
|
|
2
|
+
# Each line is a file pattern followed by one or more owners.
|
|
3
|
+
|
|
4
|
+
# These owners will be the default owners for everything in
|
|
5
|
+
# the repo. Unless a later match takes precedence,
|
|
6
|
+
# @global-owner1 and @global-owner2 will be requested for
|
|
7
|
+
# review when someone opens a pull request.
|
|
8
|
+
* @kufu/group-dev-oss
|
|
9
|
+
|
|
10
|
+
# Order is important; the last matching pattern takes the most
|
|
11
|
+
# precedence. When someone opens a pull request that only
|
|
12
|
+
# modifies JS files, only @js-owner and not the global
|
|
13
|
+
# owner(s) will be requested for a review.
|
|
14
|
+
# *.js @js-owner
|
|
15
|
+
|
|
16
|
+
# You can also use email addresses if you prefer. They'll be
|
|
17
|
+
# used to look up users just like we do for commit author
|
|
18
|
+
# emails.
|
|
19
|
+
# *.go docs@example.com
|
|
20
|
+
|
|
21
|
+
# In this example, @doctocat owns any files in the build/logs
|
|
22
|
+
# directory at the root of the repository and any of its
|
|
23
|
+
# subdirectories.
|
|
24
|
+
# /build/logs/ @doctocat
|
|
25
|
+
|
|
26
|
+
# The `docs/*` pattern will match files like
|
|
27
|
+
# `docs/getting-started.md` but not further nested files like
|
|
28
|
+
# `docs/build-app/troubleshooting.md`.
|
|
29
|
+
# docs/* docs@example.com
|
|
30
|
+
|
|
31
|
+
# In this example, @octocat owns any file in an apps directory
|
|
32
|
+
# anywhere in your repository.
|
|
33
|
+
# apps/ @octocat
|
|
34
|
+
|
|
35
|
+
# In this example, @doctocat owns any file in the `/docs`
|
|
36
|
+
# directory in the root of your repository.
|
|
37
|
+
# /docs/ @doctocat
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
pull_request:
|
|
8
|
+
types:
|
|
9
|
+
- opened
|
|
10
|
+
- synchronize
|
|
11
|
+
- reopened
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
ruby-version:
|
|
20
|
+
- 2.6
|
|
21
|
+
- 2.7
|
|
22
|
+
- '3.0' # Quoted, to avoid YAML float 3.0 interplated to "3"
|
|
23
|
+
- 3.1
|
|
24
|
+
gemfile:
|
|
25
|
+
- faraday_0
|
|
26
|
+
- faraday_1
|
|
27
|
+
- faraday_2
|
|
28
|
+
env:
|
|
29
|
+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v3
|
|
32
|
+
- uses: ruby/setup-ruby@v1
|
|
33
|
+
with:
|
|
34
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
35
|
+
bundler-cache: true
|
|
36
|
+
- name: Run tests
|
|
37
|
+
run: bundle exec rspec
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
|
@@ -36,13 +36,9 @@ Metrics/PerceivedComplexity:
|
|
|
36
36
|
Style/Documentation:
|
|
37
37
|
Enabled: false
|
|
38
38
|
|
|
39
|
-
# Offense count: 4
|
|
40
|
-
Style/RegexpLiteral:
|
|
41
|
-
MaxSlashes: 0
|
|
42
|
-
|
|
43
39
|
Metrics/ClassLength:
|
|
44
40
|
Exclude:
|
|
45
41
|
- 'lib/kiji/signer.rb'
|
|
46
42
|
|
|
47
43
|
Metrics/AbcSize:
|
|
48
|
-
Enabled: false
|
|
44
|
+
Enabled: false
|
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
* Using welcoming and inclusive language
|
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
|
19
|
+
* Gracefully accepting constructive criticism
|
|
20
|
+
* Focusing on what is best for the community
|
|
21
|
+
* Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
* Public or private harassment
|
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
+
when an individual is representing the project or its community. Examples of
|
|
50
|
+
representing a project or community include using an official project e-mail
|
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
|
53
|
+
further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
+
reported by contacting the project team at oss@smarthr.co.jp. All
|
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
|
63
|
+
|
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
+
members of the project's leadership.
|
|
67
|
+
|
|
68
|
+
## Attribution
|
|
69
|
+
|
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
|
72
|
+
|
|
73
|
+
[homepage]: http://contributor-covenant.org
|
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
kiji (0.3.0)
|
|
5
|
+
faraday (< 3)
|
|
6
|
+
nokogiri
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: https://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
addressable (2.8.1)
|
|
12
|
+
public_suffix (>= 2.0.2, < 6.0)
|
|
13
|
+
ast (2.4.2)
|
|
14
|
+
byebug (11.1.3)
|
|
15
|
+
coderay (1.1.3)
|
|
16
|
+
crack (0.4.5)
|
|
17
|
+
rexml
|
|
18
|
+
diff-lcs (1.5.0)
|
|
19
|
+
dotenv (2.8.1)
|
|
20
|
+
faraday (2.6.0)
|
|
21
|
+
faraday-net_http (>= 2.0, < 3.1)
|
|
22
|
+
ruby2_keywords (>= 0.0.4)
|
|
23
|
+
faraday-net_http (3.0.1)
|
|
24
|
+
ffi (1.15.5)
|
|
25
|
+
formatador (1.1.0)
|
|
26
|
+
guard (2.18.0)
|
|
27
|
+
formatador (>= 0.2.4)
|
|
28
|
+
listen (>= 2.7, < 4.0)
|
|
29
|
+
lumberjack (>= 1.0.12, < 2.0)
|
|
30
|
+
nenv (~> 0.1)
|
|
31
|
+
notiffany (~> 0.0)
|
|
32
|
+
pry (>= 0.13.0)
|
|
33
|
+
shellany (~> 0.0)
|
|
34
|
+
thor (>= 0.18.1)
|
|
35
|
+
guard-bundler (3.0.0)
|
|
36
|
+
bundler (>= 2.1, < 3)
|
|
37
|
+
guard (~> 2.2)
|
|
38
|
+
guard-compat (~> 1.1)
|
|
39
|
+
guard-compat (1.2.1)
|
|
40
|
+
guard-rspec (4.7.3)
|
|
41
|
+
guard (~> 2.1)
|
|
42
|
+
guard-compat (~> 1.1)
|
|
43
|
+
rspec (>= 2.99.0, < 4.0)
|
|
44
|
+
guard-rubocop (1.5.0)
|
|
45
|
+
guard (~> 2.0)
|
|
46
|
+
rubocop (< 2.0)
|
|
47
|
+
hashdiff (1.0.1)
|
|
48
|
+
json (2.6.2)
|
|
49
|
+
listen (3.7.1)
|
|
50
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
51
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
|
52
|
+
lumberjack (1.2.8)
|
|
53
|
+
method_source (1.0.0)
|
|
54
|
+
mini_portile2 (2.8.0)
|
|
55
|
+
nenv (0.3.0)
|
|
56
|
+
nokogiri (1.13.9)
|
|
57
|
+
mini_portile2 (~> 2.8.0)
|
|
58
|
+
racc (~> 1.4)
|
|
59
|
+
notiffany (0.1.3)
|
|
60
|
+
nenv (~> 0.1)
|
|
61
|
+
shellany (~> 0.0)
|
|
62
|
+
parallel (1.22.1)
|
|
63
|
+
parser (3.1.2.1)
|
|
64
|
+
ast (~> 2.4.1)
|
|
65
|
+
pry (0.14.1)
|
|
66
|
+
coderay (~> 1.1)
|
|
67
|
+
method_source (~> 1.0)
|
|
68
|
+
pry-byebug (3.10.1)
|
|
69
|
+
byebug (~> 11.0)
|
|
70
|
+
pry (>= 0.13, < 0.15)
|
|
71
|
+
public_suffix (5.0.0)
|
|
72
|
+
racc (1.6.0)
|
|
73
|
+
rainbow (3.1.1)
|
|
74
|
+
rake (13.0.6)
|
|
75
|
+
rb-fsevent (0.11.2)
|
|
76
|
+
rb-inotify (0.10.1)
|
|
77
|
+
ffi (~> 1.0)
|
|
78
|
+
regexp_parser (2.6.0)
|
|
79
|
+
rexml (3.2.5)
|
|
80
|
+
rspec (3.12.0)
|
|
81
|
+
rspec-core (~> 3.12.0)
|
|
82
|
+
rspec-expectations (~> 3.12.0)
|
|
83
|
+
rspec-mocks (~> 3.12.0)
|
|
84
|
+
rspec-core (3.12.0)
|
|
85
|
+
rspec-support (~> 3.12.0)
|
|
86
|
+
rspec-expectations (3.12.0)
|
|
87
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
88
|
+
rspec-support (~> 3.12.0)
|
|
89
|
+
rspec-mocks (3.12.0)
|
|
90
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
91
|
+
rspec-support (~> 3.12.0)
|
|
92
|
+
rspec-support (3.12.0)
|
|
93
|
+
rubocop (1.38.0)
|
|
94
|
+
json (~> 2.3)
|
|
95
|
+
parallel (~> 1.10)
|
|
96
|
+
parser (>= 3.1.2.1)
|
|
97
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
98
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
99
|
+
rexml (>= 3.2.5, < 4.0)
|
|
100
|
+
rubocop-ast (>= 1.23.0, < 2.0)
|
|
101
|
+
ruby-progressbar (~> 1.7)
|
|
102
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
103
|
+
rubocop-ast (1.23.0)
|
|
104
|
+
parser (>= 3.1.1.0)
|
|
105
|
+
ruby-progressbar (1.11.0)
|
|
106
|
+
ruby2_keywords (0.0.5)
|
|
107
|
+
rubyzip (2.3.2)
|
|
108
|
+
shellany (0.0.1)
|
|
109
|
+
thor (1.2.1)
|
|
110
|
+
unicode-display_width (2.3.0)
|
|
111
|
+
vcr (6.1.0)
|
|
112
|
+
webmock (3.18.1)
|
|
113
|
+
addressable (>= 2.8.0)
|
|
114
|
+
crack (>= 0.3.2)
|
|
115
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
|
116
|
+
|
|
117
|
+
PLATFORMS
|
|
118
|
+
ruby
|
|
119
|
+
|
|
120
|
+
DEPENDENCIES
|
|
121
|
+
bundler
|
|
122
|
+
dotenv
|
|
123
|
+
guard
|
|
124
|
+
guard-bundler
|
|
125
|
+
guard-rspec
|
|
126
|
+
guard-rubocop
|
|
127
|
+
kiji!
|
|
128
|
+
pry
|
|
129
|
+
pry-byebug
|
|
130
|
+
rake (~> 13.0)
|
|
131
|
+
rubocop
|
|
132
|
+
rubyzip
|
|
133
|
+
vcr
|
|
134
|
+
webmock
|
|
135
|
+
|
|
136
|
+
BUNDLED WITH
|
|
137
|
+
2.3.25
|
data/LICENSE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Copyright (c) 2015 Kensuke NAITO and
|
|
1
|
+
Copyright (c) 2015 Kensuke NAITO and SmartHR, Inc.
|
|
2
2
|
|
|
3
3
|
以下に定める条件に従い、本ソフトウェアおよび関連文書のファイル(以下「ソフトウェア」)の複製を取得するすべての人に対し、ソフトウェアを無制限に扱うことを無償で許可します。これには、ソフトウェアの複製を使用、複写、変更、結合、掲載、頒布、サブライセンス、および/または販売する権利、およびソフトウェアを提供する相手に同じことを許可する権利も無制限に含まれます。
|
|
4
4
|
|
|
5
5
|
上記の著作権表示および本許諾表示を、ソフトウェアのすべての複製または重要な部分に記載するものとします。
|
|
6
6
|
|
|
7
|
-
ソフトウェアは「現状のまま」で、明示であるか暗黙であるかを問わず、何らの保証もなく提供されます。ここでいう保証とは、商品性、特定の目的への適合性、および権利非侵害についての保証も含みますが、それに限定されるものではありません。 作者または著作権者は、契約行為、不法行為、またはそれ以外であろうと、ソフトウェアに起因または関連し、あるいはソフトウェアの使用またはその他の扱いによって生じる一切の請求、損害、その他の義務について何らの責任も負わないものとします。
|
|
7
|
+
ソフトウェアは「現状のまま」で、明示であるか暗黙であるかを問わず、何らの保証もなく提供されます。ここでいう保証とは、商品性、特定の目的への適合性、および権利非侵害についての保証も含みますが、それに限定されるものではありません。 作者または著作権者は、契約行為、不法行為、またはそれ以外であろうと、ソフトウェアに起因または関連し、あるいはソフトウェアの使用またはその他の扱いによって生じる一切の請求、損害、その他の義務について何らの責任も負わないものとします。
|
data/README.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
|
-
by [
|
|
3
|
+
by [SmartHR, Inc.](https://smarthr.co.jp/)
|
|
4
4
|
|
|
5
|
-
# kiji
|
|
5
|
+
# kiji [ ](https://rubygems.org/gems/kiji) [ ](https://rubygems.org/gems/kiji)
|
|
6
6
|
|
|
7
7
|
A Ruby interface to the e-Gov API.
|
|
8
8
|
|
|
9
9
|
## 理念
|
|
10
10
|
|
|
11
|
-
2008 年より[電子政府(e-Gov)のウェブサイト](
|
|
12
|
-
2010 年には e-Gov の使い勝手の向上を図り、一括申請機能の提供が開始されました。
|
|
13
|
-
そして 2014 年 10 月、さらなる利便性の向上を目的に、外部連携 API 仕様が公開されました。
|
|
11
|
+
2008 年より[電子政府(e-Gov)のウェブサイト](https://www.e-gov.go.jp/)上で社会保険・労働保険関連手続きの電子申請の受付が開始されました。
|
|
12
|
+
2010 年には e-Gov の使い勝手の向上を図り、一括申請機能の提供が開始されました。
|
|
13
|
+
そして 2014 年 10 月、さらなる利便性の向上を目的に、外部連携 API 仕様が公開されました。
|
|
14
14
|
|
|
15
15
|
これまで様々な取組が行われてきた一方で、確定申告などで利用される国税の電子申告(e-Tax)と比べるとまだまだ普及度が低いのが実情です。
|
|
16
16
|
|
|
17
|
-
わたしたちは kiji の開発・公開によって e-Gov 外部連携 API に対応したソフトウェアが増えることを期待します。
|
|
17
|
+
わたしたちは kiji の開発・公開によって e-Gov 外部連携 API に対応したソフトウェアが増えることを期待します。
|
|
18
18
|
そして、電子政府の認知度の向上、利用率の向上、及び利用の拡大に貢献し、もってユーザの利便性の向上を目指します。
|
|
19
19
|
|
|
20
20
|
|
|
@@ -107,13 +107,13 @@ client.apply(file_name, encoded_data)
|
|
|
107
107
|
|
|
108
108
|
## 事前準備
|
|
109
109
|
|
|
110
|
-
e-Gov API を利用するには外部連携 API 利用ソフトウェア開発の申込みを行い、ソフトウェア ID を入手する必要があります。
|
|
111
|
-
詳しくは [
|
|
110
|
+
e-Gov API を利用するには外部連携 API 利用ソフトウェア開発の申込みを行い、ソフトウェア ID を入手する必要があります。
|
|
111
|
+
詳しくは [スタートガイド](https://developer.e-gov.go.jp/contents/preparation)・[留意事項](https://developer.e-gov.go.jp/contents/preparation/notice.html) をご参照ください。
|
|
112
112
|
|
|
113
113
|
|
|
114
114
|
## 検証環境での利用
|
|
115
115
|
|
|
116
|
-
検証環境には BASIC 認証が設定されています。
|
|
116
|
+
検証環境には BASIC 認証が設定されています。
|
|
117
117
|
`Kiji::Client` の `basic_auth_id` および `basic_auth_password` に ID と Password をそれぞれ設定しましょう。
|
|
118
118
|
|
|
119
119
|
```ruby
|
|
@@ -124,9 +124,8 @@ client = Kiji::Client.new do |c|
|
|
|
124
124
|
end
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
また、署名に利用する証明書については e-Gov にて配布されているものを利用します。
|
|
127
|
+
また、署名に利用する証明書については e-Gov にて配布されているものを利用します。
|
|
128
128
|
|
|
129
|
-
[仕様書ダウンロード|電子政府の総合窓口e-Gov イーガブ](http://www.e-gov.go.jp/shinsei/interface_api/download.html) > 検証環境テスト用電子証明書
|
|
130
129
|
|
|
131
130
|
|
|
132
131
|
## API と メソッドの対応
|
|
@@ -165,18 +164,16 @@ end
|
|
|
165
164
|
|
|
166
165
|
## 参考リンク
|
|
167
166
|
|
|
168
|
-
- [e-Gov電子申請システム|電子政府の総合窓口e-Gov イーガブ](
|
|
167
|
+
- [e-Gov電子申請システム|電子政府の総合窓口e-Gov イーガブ](https://shinsei.e-gov.go.jp/)
|
|
169
168
|
e-Gov に関する最新情報
|
|
170
|
-
- [
|
|
171
|
-
(公式)API の仕様について
|
|
172
|
-
- [一括申請仕様公開(ソフトウェア開発事業者の方へ)|電子政府の総合窓口e-Gov イーガブ](http://www.e-gov.go.jp/shinsei/interface/index.html)
|
|
173
|
-
(公式)申請データの構造仕様について
|
|
169
|
+
- [e-Gov電子申請API (Swagger)](https://developer.e-gov.go.jp/sites/default/files/filebrowser/e-gov/swagger/) (公式)電子申請API仕様
|
|
174
170
|
|
|
175
171
|
## 注意事項
|
|
176
172
|
|
|
177
173
|
- kiji を利用する場合、必ず検証環境にて検証を行ってください。
|
|
178
174
|
- すでに最終試験に合格したソフトウェアに kiji を組み込む場合、新たにソフトウェア ID を取得し、再度最終試験に合格する必要があります。(API 利用ガイド p. 20)
|
|
179
175
|
- 最終確認試験にて合格していない API 機能を利用すると当該ソフトウェアからの e-Gov 電子申請システムへの接続が制限されます。ご注意ください。(API 利用ガイド p. 20)
|
|
176
|
+
- ※外部連携APIを利用したソフトウェア等の新規開発申込み受付は、既に終了しており、2022年12月31日をもってサポート終了
|
|
180
177
|
|
|
181
178
|
## Contributing
|
|
182
179
|
|
|
@@ -186,31 +183,33 @@ end
|
|
|
186
183
|
4. Push to the branch (`git push origin my-new-feature`)
|
|
187
184
|
5. Create a new Pull Request
|
|
188
185
|
|
|
186
|
+
## Code of Conduct
|
|
187
|
+
|
|
188
|
+
Everyone interacting in the kiji project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kufu/kiji/blob/master/CODE_OF_CONDUCT.md).
|
|
189
|
+
|
|
189
190
|
|
|
190
191
|
## Copyright
|
|
191
192
|
|
|
192
|
-
Copyright (c) 2015 Kensuke NAITO and
|
|
193
|
+
Copyright (c) 2015 Kensuke NAITO and SmartHR, Inc.
|
|
193
194
|
ライセンスはこちら: [kiji/LICENSE.md](https://github.com/kufu/kiji/blob/master/LICENSE.md)
|
|
194
195
|
|
|
195
196
|
|
|
196
|
-
#
|
|
197
|
-
|
|
198
|
-

|
|
197
|
+
# SmartHR について
|
|
199
198
|
|
|
200
|
-
kiji は株式会社
|
|
201
|
-
わたしたちは OSS の力を信じています。
|
|
199
|
+
kiji は株式会社 SmartHR によってメンテナンス、開発が行われています。
|
|
200
|
+
わたしたちは OSS の力を信じています。
|
|
202
201
|
|
|
203
|
-
|
|
202
|
+
SmartHR では OSS 活動に積極的なエンジニアを募集しています!
|
|
204
203
|
|
|
205
|
-
[
|
|
204
|
+
[SmartHR Engineer Recruiting](https://smarthr.co.jp/recruit/hello-world)
|
|
206
205
|
|
|
207
206
|
|
|
208
207
|
# kiji について
|
|
209
208
|
|
|
210
|
-
キジ(雉子、雉、学名: Phasianus versicolor)は、キジ目キジ科キジ属の鳥の一種で、日本の国鳥です。
|
|
211
|
-
オスは美しい緑色の羽で覆われ、長い尾と目の周りに赤い肉腫を持つことが特徴です。
|
|
209
|
+
キジ(雉子、雉、学名: Phasianus versicolor)は、キジ目キジ科キジ属の鳥の一種で、日本の国鳥です。
|
|
210
|
+
オスは美しい緑色の羽で覆われ、長い尾と目の周りに赤い肉腫を持つことが特徴です。
|
|
212
211
|
飛ぶのはそれほど得意ではない一方で、発達した筋肉により時速 30 キロメートルで走ることができます。
|
|
213
|
-
古来より日本人と関わりの深い鳥として「日本書紀」、「万葉集」、「桃太郎」をはじめ、様々な文学作品に登場してきました。
|
|
212
|
+
古来より日本人と関わりの深い鳥として「日本書紀」、「万葉集」、「桃太郎」をはじめ、様々な文学作品に登場してきました。
|
|
214
213
|
国鳥であるにも関わらず狩猟が許可されているというちょっと悲しい鳥でもあります。
|
|
215
214
|
|
|
216
215
|
kiji のロゴは「きじ馬(あるいは雉子車)」と呼ばれる、九州地方に伝わる郷土玩具をモチーフとしています。
|
data/bin/console
CHANGED
|
File without changes
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
3
|
require 'kiji/version'
|
|
5
4
|
|
|
@@ -21,22 +20,21 @@ Gem::Specification.new do |spec|
|
|
|
21
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
22
21
|
spec.require_paths = ['lib']
|
|
23
22
|
|
|
24
|
-
spec.add_development_dependency 'bundler'
|
|
25
|
-
spec.add_development_dependency '
|
|
26
|
-
spec.add_development_dependency 'rubocop'
|
|
23
|
+
spec.add_development_dependency 'bundler'
|
|
24
|
+
spec.add_development_dependency 'dotenv'
|
|
27
25
|
spec.add_development_dependency 'guard'
|
|
28
|
-
spec.add_development_dependency 'guard-rspec'
|
|
29
26
|
spec.add_development_dependency 'guard-bundler'
|
|
27
|
+
spec.add_development_dependency 'guard-rspec'
|
|
30
28
|
spec.add_development_dependency 'guard-rubocop'
|
|
31
29
|
spec.add_development_dependency 'pry'
|
|
32
30
|
spec.add_development_dependency 'pry-byebug'
|
|
33
|
-
spec.add_development_dependency '
|
|
34
|
-
spec.add_development_dependency '
|
|
35
|
-
spec.add_development_dependency 'vcr'
|
|
31
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
|
32
|
+
spec.add_development_dependency 'rubocop'
|
|
36
33
|
spec.add_development_dependency 'rubyzip'
|
|
34
|
+
spec.add_development_dependency 'vcr'
|
|
35
|
+
spec.add_development_dependency 'webmock'
|
|
37
36
|
|
|
38
37
|
# spec.add_runtime_dependency 'signer'
|
|
39
|
-
spec.add_runtime_dependency 'faraday'
|
|
38
|
+
spec.add_runtime_dependency 'faraday', '< 3'
|
|
40
39
|
spec.add_runtime_dependency 'nokogiri'
|
|
41
|
-
spec.add_runtime_dependency 'activesupport'
|
|
42
40
|
end
|
data/lib/kiji/access.rb
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
require 'active_support'
|
|
2
|
-
require 'active_support/core_ext/object'
|
|
3
|
-
|
|
4
1
|
module Kiji
|
|
5
2
|
module Access
|
|
6
3
|
def apply(file_name, file_data)
|
|
7
4
|
appl_data = Nokogiri::XML::Builder.new do |xml|
|
|
8
|
-
xml.DataRoot
|
|
9
|
-
xml.ApplData(Id: 'ApplData')
|
|
10
|
-
xml.Upload
|
|
5
|
+
xml.DataRoot do
|
|
6
|
+
xml.ApplData(Id: 'ApplData') do
|
|
7
|
+
xml.Upload do
|
|
11
8
|
xml.FileName file_name
|
|
12
9
|
xml.FileData file_data
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
16
13
|
end
|
|
17
14
|
|
|
18
15
|
connection.post('/shinsei/1/access/apply') do |req|
|
|
@@ -38,14 +35,14 @@ module Kiji
|
|
|
38
35
|
|
|
39
36
|
def withdraw(arrive_id, file_data)
|
|
40
37
|
appl_data = Nokogiri::XML::Builder.new do |xml|
|
|
41
|
-
xml.DataRoot
|
|
42
|
-
xml.ApplData(Id: 'ApplData')
|
|
38
|
+
xml.DataRoot do
|
|
39
|
+
xml.ApplData(Id: 'ApplData') do
|
|
43
40
|
xml.ArriveID arrive_id
|
|
44
|
-
xml.Upload
|
|
41
|
+
xml.Upload do
|
|
45
42
|
xml.FileData file_data
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
49
46
|
end
|
|
50
47
|
|
|
51
48
|
connection.post('/shinsei/1/access/withdrawal') do |req|
|
|
@@ -59,14 +56,14 @@ module Kiji
|
|
|
59
56
|
|
|
60
57
|
def reamend(arrive_id, file_data)
|
|
61
58
|
appl_data = Nokogiri::XML::Builder.new do |xml|
|
|
62
|
-
xml.DataRoot
|
|
63
|
-
xml.ApplData(Id: 'ApplData')
|
|
59
|
+
xml.DataRoot do
|
|
60
|
+
xml.ApplData(Id: 'ApplData') do
|
|
64
61
|
xml.ArriveID arrive_id
|
|
65
|
-
xml.Upload
|
|
62
|
+
xml.Upload do
|
|
66
63
|
xml.FileData file_data
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
70
67
|
end
|
|
71
68
|
|
|
72
69
|
connection.post('/shinsei/1/access/reamend') do |req|
|
|
@@ -76,18 +73,18 @@ module Kiji
|
|
|
76
73
|
|
|
77
74
|
def partamend(arrive_id, basic_form_flag, attached_flag, file_data)
|
|
78
75
|
appl_data = Nokogiri::XML::Builder.new do |xml|
|
|
79
|
-
xml.DataRoot
|
|
80
|
-
xml.ApplData(Id: 'ApplData')
|
|
76
|
+
xml.DataRoot do
|
|
77
|
+
xml.ApplData(Id: 'ApplData') do
|
|
81
78
|
xml.ArriveID arrive_id
|
|
82
|
-
xml.Target
|
|
79
|
+
xml.Target do
|
|
83
80
|
xml.BasicFormFlag basic_form_flag ? '1' : '0'
|
|
84
81
|
xml.AttachedFlag attached_flag ? '1' : '0'
|
|
85
|
-
|
|
86
|
-
xml.Upload
|
|
82
|
+
end
|
|
83
|
+
xml.Upload do
|
|
87
84
|
xml.FileData file_data
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
91
88
|
end
|
|
92
89
|
|
|
93
90
|
connection.post('/shinsei/1/access/partamend') do |req|
|
|
@@ -97,14 +94,14 @@ module Kiji
|
|
|
97
94
|
|
|
98
95
|
def amendapply(arrive_id, file_data)
|
|
99
96
|
appl_data = Nokogiri::XML::Builder.new do |xml|
|
|
100
|
-
xml.DataRoot
|
|
101
|
-
xml.ApplData(Id: 'ApplData')
|
|
97
|
+
xml.DataRoot do
|
|
98
|
+
xml.ApplData(Id: 'ApplData') do
|
|
102
99
|
xml.ArriveID arrive_id
|
|
103
|
-
xml.Upload
|
|
100
|
+
xml.Upload do
|
|
104
101
|
xml.FileData file_data
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
108
105
|
end
|
|
109
106
|
|
|
110
107
|
connection.post('/shinsei/1/access/amendapply') do |req|
|
|
@@ -122,12 +119,12 @@ module Kiji
|
|
|
122
119
|
|
|
123
120
|
def done_officialdocument(arrive_id, notice_sub_id)
|
|
124
121
|
appl_data = Nokogiri::XML::Builder.new do |xml|
|
|
125
|
-
xml.DataRoot
|
|
126
|
-
xml.ApplData(Id: 'ApplData')
|
|
122
|
+
xml.DataRoot do
|
|
123
|
+
xml.ApplData(Id: 'ApplData') do
|
|
127
124
|
xml.ArriveID arrive_id
|
|
128
125
|
xml.NoticeSubID notice_sub_id
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
end
|
|
127
|
+
end
|
|
131
128
|
end
|
|
132
129
|
|
|
133
130
|
connection.put('/shinsei/1/access/officialdocument') do |req|
|
|
@@ -137,16 +134,16 @@ module Kiji
|
|
|
137
134
|
|
|
138
135
|
def verify_officialdocument(arrive_id, file_name, file_data, sig_xml_file_name)
|
|
139
136
|
appl_data = Nokogiri::XML::Builder.new do |xml|
|
|
140
|
-
xml.DataRoot
|
|
141
|
-
xml.ApplData(Id: 'ApplData')
|
|
137
|
+
xml.DataRoot do
|
|
138
|
+
xml.ApplData(Id: 'ApplData') do
|
|
142
139
|
xml.ArriveID arrive_id
|
|
143
|
-
xml.Upload
|
|
140
|
+
xml.Upload do
|
|
144
141
|
xml.FileName file_name
|
|
145
142
|
xml.FileData file_data
|
|
146
143
|
xml.SigVerificationXMLFileName sig_xml_file_name
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
|
150
147
|
end
|
|
151
148
|
|
|
152
149
|
connection.post('/shinsei/1/access/officialdocument/verify') do |req|
|
|
@@ -160,12 +157,12 @@ module Kiji
|
|
|
160
157
|
|
|
161
158
|
def done_comment(arrive_id, notice_sub_id)
|
|
162
159
|
appl_data = Nokogiri::XML::Builder.new do |xml|
|
|
163
|
-
xml.DataRoot
|
|
164
|
-
xml.ApplData(Id: 'ApplData')
|
|
160
|
+
xml.DataRoot do
|
|
161
|
+
xml.ApplData(Id: 'ApplData') do
|
|
165
162
|
xml.ArriveID arrive_id
|
|
166
163
|
xml.NoticeSubID notice_sub_id
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
end
|
|
165
|
+
end
|
|
169
166
|
end
|
|
170
167
|
|
|
171
168
|
connection.put('/shinsei/1/access/comment') do |req|
|
data/lib/kiji/authentication.rb
CHANGED
|
@@ -2,11 +2,11 @@ module Kiji
|
|
|
2
2
|
module Authentication
|
|
3
3
|
def register(user_id)
|
|
4
4
|
appl_data = Nokogiri::XML::Builder.new do |xml|
|
|
5
|
-
xml.DataRoot
|
|
6
|
-
xml.ApplData(Id: 'ApplData')
|
|
5
|
+
xml.DataRoot do
|
|
6
|
+
xml.ApplData(Id: 'ApplData') do
|
|
7
7
|
xml.UserID user_id
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
connection.post('/shinsei/1/authentication/user') do |req|
|
|
@@ -16,11 +16,11 @@ module Kiji
|
|
|
16
16
|
|
|
17
17
|
def login(user_id)
|
|
18
18
|
appl_data = Nokogiri::XML::Builder.new do |xml|
|
|
19
|
-
xml.DataRoot
|
|
20
|
-
xml.ApplData(Id: 'ApplData')
|
|
19
|
+
xml.DataRoot do
|
|
20
|
+
xml.ApplData(Id: 'ApplData') do
|
|
21
21
|
xml.UserID user_id
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
connection.post('/shinsei/1/authentication/login') do |req|
|
|
@@ -32,12 +32,12 @@ module Kiji
|
|
|
32
32
|
x509_cert = Base64.encode64(new_cert.to_der).gsub('\n', '')
|
|
33
33
|
|
|
34
34
|
appl_data = Nokogiri::XML::Builder.new do |xml|
|
|
35
|
-
xml.DataRoot
|
|
36
|
-
xml.ApplData(Id: 'ApplData')
|
|
35
|
+
xml.DataRoot do
|
|
36
|
+
xml.ApplData(Id: 'ApplData') do
|
|
37
37
|
xml.UserID user_id
|
|
38
38
|
xml.AddX509Certificate x509_cert
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
connection.post('/shinsei/1/authentication/certificate/append') do |req|
|
|
@@ -49,12 +49,12 @@ module Kiji
|
|
|
49
49
|
x509_cert = Base64.encode64(old_cert.to_der).gsub('\n', '')
|
|
50
50
|
|
|
51
51
|
appl_data = Nokogiri::XML::Builder.new do |xml|
|
|
52
|
-
xml.DataRoot
|
|
53
|
-
xml.ApplData(Id: 'ApplData')
|
|
52
|
+
xml.DataRoot do
|
|
53
|
+
xml.ApplData(Id: 'ApplData') do
|
|
54
54
|
xml.UserID user_id
|
|
55
55
|
xml.X509Certificate x509_cert
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
connection.post('/shinsei/1/authentication/certificate/update') do |req|
|
|
@@ -66,12 +66,12 @@ module Kiji
|
|
|
66
66
|
x509_cert = Base64.encode64(cert_to_delete.to_der).gsub('\n', '')
|
|
67
67
|
|
|
68
68
|
appl_data = Nokogiri::XML::Builder.new do |xml|
|
|
69
|
-
xml.DataRoot
|
|
70
|
-
xml.ApplData(Id: 'ApplData')
|
|
69
|
+
xml.DataRoot do
|
|
70
|
+
xml.ApplData(Id: 'ApplData') do
|
|
71
71
|
xml.UserID user_id
|
|
72
72
|
xml.DelX509Certificate x509_cert
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
connection.post('/shinsei/1/authentication/certificate/delete') do |req|
|
data/lib/kiji/client.rb
CHANGED
|
@@ -24,17 +24,25 @@ module Kiji
|
|
|
24
24
|
Faraday.new(url: @api_end_point) do |c|
|
|
25
25
|
# c.response :logger
|
|
26
26
|
c.adapter Faraday.default_adapter
|
|
27
|
-
c.
|
|
27
|
+
c.request(*authentication_middleware_keys, @basic_auth_id, @basic_auth_password) unless @basic_auth_id.nil?
|
|
28
28
|
c.headers['User-Agent'] = 'SmartHR v0.0.1'
|
|
29
29
|
c.headers['x-eGovAPI-SoftwareID'] = software_id
|
|
30
30
|
c.headers['x-eGovAPI-AccessKey'] = access_key unless access_key.nil?
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
def authentication_middleware_keys
|
|
35
|
+
if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0.0')
|
|
36
|
+
%i[authorization basic]
|
|
37
|
+
else
|
|
38
|
+
[:basic_auth]
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
34
42
|
def sign(appl_data)
|
|
35
|
-
|
|
43
|
+
raise 'Please specify cert & private_key' if cert.nil? || private_key.nil?
|
|
36
44
|
|
|
37
|
-
doc = appl_data.to_xml(save_with:
|
|
45
|
+
doc = appl_data.to_xml(save_with: 0)
|
|
38
46
|
|
|
39
47
|
signer = Signer.new(doc) do |s|
|
|
40
48
|
s.cert = cert
|
data/lib/kiji/digester.rb
CHANGED
|
@@ -24,7 +24,7 @@ module Kiji
|
|
|
24
24
|
id: 'http://www.w3.org/2001/04/xmldsig-more#gostr3411',
|
|
25
25
|
digester: -> { OpenSSL::Digest.new('md_gost94') }
|
|
26
26
|
}
|
|
27
|
-
}
|
|
27
|
+
}.freeze
|
|
28
28
|
|
|
29
29
|
# Class that holds +OpenSSL::Digest+ instance with some meta information for digesting in XML.
|
|
30
30
|
class Digester
|
|
@@ -57,7 +57,7 @@ module Kiji
|
|
|
57
57
|
[[hex].pack('H*')].pack('m0')
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
alias call digest
|
|
61
61
|
|
|
62
62
|
# Returns +OpenSSL::Digest+ (or derived class) instance
|
|
63
63
|
def digester
|
data/lib/kiji/signer.rb
CHANGED
|
@@ -14,14 +14,14 @@ module Kiji
|
|
|
14
14
|
attr_reader :cert
|
|
15
15
|
attr_writer :security_node, :signature_node, :security_token_id
|
|
16
16
|
|
|
17
|
-
WSU_NAMESPACE = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'
|
|
18
|
-
WSSE_NAMESPACE = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
|
|
17
|
+
WSU_NAMESPACE = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'.freeze
|
|
18
|
+
WSSE_NAMESPACE = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'.freeze
|
|
19
19
|
|
|
20
20
|
def initialize(document)
|
|
21
21
|
# self.document = Nokogiri::XML(document.to_s, &:noblanks)
|
|
22
22
|
self.document = Nokogiri::XML(document.to_s)
|
|
23
23
|
self.digest_algorithm = :sha1
|
|
24
|
-
|
|
24
|
+
set_default_signature_method!
|
|
25
25
|
|
|
26
26
|
yield(self) if block_given?
|
|
27
27
|
end
|
|
@@ -66,7 +66,7 @@ module Kiji
|
|
|
66
66
|
self.signature_algorithm_id = 'http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411'
|
|
67
67
|
# Add clauses for other types of keys that require other digest algorithms and identifiers
|
|
68
68
|
else # most common 'sha1WithRSAEncryption' type included here
|
|
69
|
-
|
|
69
|
+
set_default_signature_method! # Reset any changes as they can become malformed
|
|
70
70
|
end
|
|
71
71
|
end
|
|
72
72
|
|
|
@@ -134,7 +134,7 @@ module Kiji
|
|
|
134
134
|
node = Nokogiri::XML::Node.new('BinarySecurityToken', document)
|
|
135
135
|
node['ValueType'] = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3'
|
|
136
136
|
node['EncodingType'] = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary'
|
|
137
|
-
node.content = Base64.encode64(cert.to_der).
|
|
137
|
+
node.content = Base64.encode64(cert.to_der).delete("\n")
|
|
138
138
|
signature_node.add_previous_sibling(node)
|
|
139
139
|
wsse_ns = namespace_prefix(node, WSSE_NAMESPACE, 'wsse')
|
|
140
140
|
wsu_ns = namespace_prefix(node, WSU_NAMESPACE, 'wsu')
|
|
@@ -167,14 +167,14 @@ module Kiji
|
|
|
167
167
|
# issuer_serial_node.add_child(issuer_name_node)
|
|
168
168
|
# issuer_serial_node.add_child(issuer_number_node)
|
|
169
169
|
|
|
170
|
-
cetificate_node
|
|
171
|
-
cetificate_node.content = Base64.encode64(cert.to_der).
|
|
170
|
+
cetificate_node = Nokogiri::XML::Node.new('X509Certificate', document)
|
|
171
|
+
cetificate_node.content = Base64.encode64(cert.to_der).delete("\n")
|
|
172
172
|
|
|
173
|
-
data_node
|
|
173
|
+
data_node = Nokogiri::XML::Node.new('X509Data', document)
|
|
174
174
|
# data_node.add_child(issuer_serial_node)
|
|
175
175
|
data_node.add_child(cetificate_node)
|
|
176
176
|
|
|
177
|
-
key_info_node
|
|
177
|
+
key_info_node = Nokogiri::XML::Node.new('KeyInfo', document)
|
|
178
178
|
key_info_node.add_child(data_node)
|
|
179
179
|
|
|
180
180
|
signed_info_node.add_next_sibling(key_info_node)
|
|
@@ -205,7 +205,7 @@ module Kiji
|
|
|
205
205
|
|
|
206
206
|
def digest!(target_node, options = {})
|
|
207
207
|
wsu_ns = namespace_prefix(target_node, WSU_NAMESPACE)
|
|
208
|
-
current_id = target_node["#{wsu_ns}:Id"]
|
|
208
|
+
current_id = target_node["#{wsu_ns}:Id"] if wsu_ns
|
|
209
209
|
id = options[:id] || current_id || "_#{Digest::SHA1.hexdigest(target_node.to_s)}"
|
|
210
210
|
# if id.to_s.size > 0
|
|
211
211
|
# wsu_ns ||= namespace_prefix(target_node, WSU_NAMESPACE, 'wsu')
|
|
@@ -216,19 +216,19 @@ module Kiji
|
|
|
216
216
|
target_digest = @digester.base64(target_canon)
|
|
217
217
|
|
|
218
218
|
reference_node = Nokogiri::XML::Node.new('Reference', document)
|
|
219
|
-
reference_node['URI'] = id.to_s.
|
|
219
|
+
reference_node['URI'] = !id.to_s.empty? ? encode_ja(id) : ''
|
|
220
220
|
signed_info_node.add_child(reference_node)
|
|
221
221
|
|
|
222
222
|
transforms_node = Nokogiri::XML::Node.new('Transforms', document)
|
|
223
223
|
reference_node.add_child(transforms_node)
|
|
224
224
|
|
|
225
225
|
transform_node = Nokogiri::XML::Node.new('Transform', document)
|
|
226
|
-
if options[:enveloped]
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
226
|
+
transform_node['Algorithm'] = if options[:enveloped]
|
|
227
|
+
'http://www.w3.org/2000/09/xmldsig#enveloped-signature'
|
|
228
|
+
else
|
|
229
|
+
# transform_node['Algorithm'] = 'http://www.w3.org/2001/10/xml-exc-c14n#'
|
|
230
|
+
'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'
|
|
231
|
+
end
|
|
232
232
|
if options[:inclusive_namespaces]
|
|
233
233
|
inclusive_namespaces_node = Nokogiri::XML::Node.new('ec:InclusiveNamespaces', document)
|
|
234
234
|
inclusive_namespaces_node.add_namespace_definition('ec', transform_node['Algorithm'])
|
|
@@ -253,7 +253,7 @@ module Kiji
|
|
|
253
253
|
|
|
254
254
|
reference_node = Nokogiri::XML::Node.new('Reference', document)
|
|
255
255
|
id = options[:id]
|
|
256
|
-
reference_node['URI'] = id.to_s.
|
|
256
|
+
reference_node['URI'] = !id.to_s.empty? ? encode_ja(id) : ''
|
|
257
257
|
signed_info_node.add_child(reference_node)
|
|
258
258
|
|
|
259
259
|
digest_method_node = Nokogiri::XML::Node.new('DigestMethod', document)
|
|
@@ -291,7 +291,7 @@ module Kiji
|
|
|
291
291
|
signed_info_canon = canonicalize(signed_info_node, options[:inclusive_namespaces])
|
|
292
292
|
|
|
293
293
|
signature = private_key.sign(@sign_digester.digester, signed_info_canon)
|
|
294
|
-
signature_value_digest = Base64.encode64(signature).
|
|
294
|
+
signature_value_digest = Base64.encode64(signature).delete("\n")
|
|
295
295
|
|
|
296
296
|
signature_value_node = Nokogiri::XML::Node.new('SignatureValue', document)
|
|
297
297
|
signature_value_node.content = signature_value_digest
|
data/lib/kiji/version.rb
CHANGED
data/lib/kiji/zipper.rb
CHANGED
|
@@ -8,7 +8,7 @@ module Kiji
|
|
|
8
8
|
|
|
9
9
|
# 構成管理ファイル(kouse.xml)に署名を施す
|
|
10
10
|
def sign(kousei_base_file_path_or_content, app_file_paths)
|
|
11
|
-
|
|
11
|
+
raise 'Please specify cert & private_key' if @cert.nil? || @private_key.nil?
|
|
12
12
|
|
|
13
13
|
content = begin
|
|
14
14
|
File.read(kousei_base_file_path_or_content)
|
|
@@ -17,7 +17,7 @@ module Kiji
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
kousei_data = Nokogiri::XML(content)
|
|
20
|
-
kousei_doc = kousei_data.to_xml(save_with:
|
|
20
|
+
kousei_doc = kousei_data.to_xml(save_with: 0)
|
|
21
21
|
|
|
22
22
|
signer = Signer.new(kousei_doc) do |s|
|
|
23
23
|
s.cert = @cert
|
|
@@ -54,7 +54,7 @@ module Kiji
|
|
|
54
54
|
@input_dir = input_dir
|
|
55
55
|
@output_file = output_file
|
|
56
56
|
|
|
57
|
-
entries = Dir.entries(@input_dir) - %w
|
|
57
|
+
entries = Dir.entries(@input_dir) - %w[. .. .DS_Store]
|
|
58
58
|
Zip.sort_entries = true
|
|
59
59
|
Zip::File.open(output_file, Zip::File::CREATE) do |io|
|
|
60
60
|
write_entries(entries, '', io)
|
|
@@ -78,7 +78,7 @@ module Kiji
|
|
|
78
78
|
|
|
79
79
|
def recursively_deflate_directory(disk_file_path, io, zip_file_path)
|
|
80
80
|
# io.mkdir(zip_file_path)
|
|
81
|
-
subdir = Dir.entries(disk_file_path) - %w
|
|
81
|
+
subdir = Dir.entries(disk_file_path) - %w[. .. .DS_Store]
|
|
82
82
|
write_entries(subdir, zip_file_path, io)
|
|
83
83
|
end
|
|
84
84
|
|
metadata
CHANGED
|
@@ -1,45 +1,31 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kiji
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kakipo
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-11-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.8'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.8'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: rake
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - "~>"
|
|
17
|
+
- - ">="
|
|
32
18
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
19
|
+
version: '0'
|
|
34
20
|
type: :development
|
|
35
21
|
prerelease: false
|
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
23
|
requirements:
|
|
38
|
-
- - "
|
|
24
|
+
- - ">="
|
|
39
25
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
26
|
+
version: '0'
|
|
41
27
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
28
|
+
name: dotenv
|
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
|
44
30
|
requirements:
|
|
45
31
|
- - ">="
|
|
@@ -67,7 +53,7 @@ dependencies:
|
|
|
67
53
|
- !ruby/object:Gem::Version
|
|
68
54
|
version: '0'
|
|
69
55
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: guard-
|
|
56
|
+
name: guard-bundler
|
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
|
72
58
|
requirements:
|
|
73
59
|
- - ">="
|
|
@@ -81,7 +67,7 @@ dependencies:
|
|
|
81
67
|
- !ruby/object:Gem::Version
|
|
82
68
|
version: '0'
|
|
83
69
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name: guard-
|
|
70
|
+
name: guard-rspec
|
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
|
86
72
|
requirements:
|
|
87
73
|
- - ">="
|
|
@@ -137,21 +123,21 @@ dependencies:
|
|
|
137
123
|
- !ruby/object:Gem::Version
|
|
138
124
|
version: '0'
|
|
139
125
|
- !ruby/object:Gem::Dependency
|
|
140
|
-
name:
|
|
126
|
+
name: rake
|
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
|
142
128
|
requirements:
|
|
143
|
-
- - "
|
|
129
|
+
- - "~>"
|
|
144
130
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: '0'
|
|
131
|
+
version: '13.0'
|
|
146
132
|
type: :development
|
|
147
133
|
prerelease: false
|
|
148
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
135
|
requirements:
|
|
150
|
-
- - "
|
|
136
|
+
- - "~>"
|
|
151
137
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: '0'
|
|
138
|
+
version: '13.0'
|
|
153
139
|
- !ruby/object:Gem::Dependency
|
|
154
|
-
name:
|
|
140
|
+
name: rubocop
|
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|
|
156
142
|
requirements:
|
|
157
143
|
- - ">="
|
|
@@ -165,7 +151,7 @@ dependencies:
|
|
|
165
151
|
- !ruby/object:Gem::Version
|
|
166
152
|
version: '0'
|
|
167
153
|
- !ruby/object:Gem::Dependency
|
|
168
|
-
name:
|
|
154
|
+
name: rubyzip
|
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
|
170
156
|
requirements:
|
|
171
157
|
- - ">="
|
|
@@ -179,7 +165,7 @@ dependencies:
|
|
|
179
165
|
- !ruby/object:Gem::Version
|
|
180
166
|
version: '0'
|
|
181
167
|
- !ruby/object:Gem::Dependency
|
|
182
|
-
name:
|
|
168
|
+
name: vcr
|
|
183
169
|
requirement: !ruby/object:Gem::Requirement
|
|
184
170
|
requirements:
|
|
185
171
|
- - ">="
|
|
@@ -193,13 +179,13 @@ dependencies:
|
|
|
193
179
|
- !ruby/object:Gem::Version
|
|
194
180
|
version: '0'
|
|
195
181
|
- !ruby/object:Gem::Dependency
|
|
196
|
-
name:
|
|
182
|
+
name: webmock
|
|
197
183
|
requirement: !ruby/object:Gem::Requirement
|
|
198
184
|
requirements:
|
|
199
185
|
- - ">="
|
|
200
186
|
- !ruby/object:Gem::Version
|
|
201
187
|
version: '0'
|
|
202
|
-
type: :
|
|
188
|
+
type: :development
|
|
203
189
|
prerelease: false
|
|
204
190
|
version_requirements: !ruby/object:Gem::Requirement
|
|
205
191
|
requirements:
|
|
@@ -207,21 +193,21 @@ dependencies:
|
|
|
207
193
|
- !ruby/object:Gem::Version
|
|
208
194
|
version: '0'
|
|
209
195
|
- !ruby/object:Gem::Dependency
|
|
210
|
-
name:
|
|
196
|
+
name: faraday
|
|
211
197
|
requirement: !ruby/object:Gem::Requirement
|
|
212
198
|
requirements:
|
|
213
|
-
- - "
|
|
199
|
+
- - "<"
|
|
214
200
|
- !ruby/object:Gem::Version
|
|
215
|
-
version: '
|
|
201
|
+
version: '3'
|
|
216
202
|
type: :runtime
|
|
217
203
|
prerelease: false
|
|
218
204
|
version_requirements: !ruby/object:Gem::Requirement
|
|
219
205
|
requirements:
|
|
220
|
-
- - "
|
|
206
|
+
- - "<"
|
|
221
207
|
- !ruby/object:Gem::Version
|
|
222
|
-
version: '
|
|
208
|
+
version: '3'
|
|
223
209
|
- !ruby/object:Gem::Dependency
|
|
224
|
-
name:
|
|
210
|
+
name: nokogiri
|
|
225
211
|
requirement: !ruby/object:Gem::Requirement
|
|
226
212
|
requirements:
|
|
227
213
|
- - ">="
|
|
@@ -234,26 +220,33 @@ dependencies:
|
|
|
234
220
|
- - ">="
|
|
235
221
|
- !ruby/object:Gem::Version
|
|
236
222
|
version: '0'
|
|
237
|
-
description:
|
|
223
|
+
description:
|
|
238
224
|
email:
|
|
239
225
|
- kakipo@gmail.com
|
|
240
226
|
executables: []
|
|
241
227
|
extensions: []
|
|
242
228
|
extra_rdoc_files: []
|
|
243
229
|
files:
|
|
230
|
+
- ".github/CODEOWNERS"
|
|
231
|
+
- ".github/workflows/test.yml"
|
|
244
232
|
- ".gitignore"
|
|
245
233
|
- ".rspec"
|
|
246
234
|
- ".rubocop.yml"
|
|
247
235
|
- ".rubocop_todo.yml"
|
|
248
236
|
- ".travis.yml"
|
|
237
|
+
- CODE_OF_CONDUCT.md
|
|
249
238
|
- Gemfile
|
|
239
|
+
- Gemfile.lock
|
|
250
240
|
- Guardfile
|
|
251
241
|
- LICENSE.md
|
|
252
242
|
- README.md
|
|
253
243
|
- Rakefile
|
|
254
244
|
- bin/console
|
|
255
245
|
- bin/setup
|
|
256
|
-
-
|
|
246
|
+
- gemfiles/faraday_0.gemfile
|
|
247
|
+
- gemfiles/faraday_1.gemfile
|
|
248
|
+
- gemfiles/faraday_2.gemfile
|
|
249
|
+
- kiji.gemspec
|
|
257
250
|
- lib/kiji.rb
|
|
258
251
|
- lib/kiji/access.rb
|
|
259
252
|
- lib/kiji/api.rb
|
|
@@ -269,7 +262,7 @@ homepage: https://github.com/kufu/kiji
|
|
|
269
262
|
licenses:
|
|
270
263
|
- MIT
|
|
271
264
|
metadata: {}
|
|
272
|
-
post_install_message:
|
|
265
|
+
post_install_message:
|
|
273
266
|
rdoc_options: []
|
|
274
267
|
require_paths:
|
|
275
268
|
- lib
|
|
@@ -284,9 +277,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
284
277
|
- !ruby/object:Gem::Version
|
|
285
278
|
version: '0'
|
|
286
279
|
requirements: []
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
signing_key:
|
|
280
|
+
rubygems_version: 3.3.7
|
|
281
|
+
signing_key:
|
|
290
282
|
specification_version: 4
|
|
291
283
|
summary: API toolkits for Japanese e-Gov system
|
|
292
284
|
test_files: []
|