kgrift 1.3.108
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 +7 -0
- data/KGrift/Gemfile +22 -0
- data/KGrift/README.md +66 -0
- data/KGrift/bin/kgrift +11 -0
- data/KGrift/grifter.yml +224 -0
- data/KGrift/internal_test_graphs/basic_test_graph_definition.yml +2915 -0
- data/KGrift/internal_test_graphs/unicode_test_graph_definition.yml +3070 -0
- data/KGrift/knewton_grifts/analytics_grifts.rb +103 -0
- data/KGrift/knewton_grifts/async_helper_grifts.rb +63 -0
- data/KGrift/knewton_grifts/authenticator_grifts.rb +46 -0
- data/KGrift/knewton_grifts/basic_grifts.rb +29 -0
- data/KGrift/knewton_grifts/batch_grifts.rb +14 -0
- data/KGrift/knewton_grifts/content_collection_grifts.rb +204 -0
- data/KGrift/knewton_grifts/content_collection_v1_grifts.rb +521 -0
- data/KGrift/knewton_grifts/content_eid_grifts.rb +41 -0
- data/KGrift/knewton_grifts/copy_grifts.rb +151 -0
- data/KGrift/knewton_grifts/deprecated_graph_and_taxonomy_grifts.rb +353 -0
- data/KGrift/knewton_grifts/goal_grifts.rb +203 -0
- data/KGrift/knewton_grifts/graph_and_taxonomy_grifts.rb +136 -0
- data/KGrift/knewton_grifts/graph_create_grifts.rb +34 -0
- data/KGrift/knewton_grifts/graph_query_grifts.rb +448 -0
- data/KGrift/knewton_grifts/graph_tools_grifts.rb +151 -0
- data/KGrift/knewton_grifts/graph_validation_grifts.rb +447 -0
- data/KGrift/knewton_grifts/helper_grifts.rb +92 -0
- data/KGrift/knewton_grifts/jmeter_data_grifts.rb +56 -0
- data/KGrift/knewton_grifts/learning_instance_grifts.rb +46 -0
- data/KGrift/knewton_grifts/looper_grifts.rb +34 -0
- data/KGrift/knewton_grifts/moxy_grifts.rb +64 -0
- data/KGrift/knewton_grifts/oauth_grifts.rb +182 -0
- data/KGrift/knewton_grifts/partner_grifts.rb +70 -0
- data/KGrift/knewton_grifts/partner_support_grifts.rb +85 -0
- data/KGrift/knewton_grifts/recommendation_setup_grifts.rb +215 -0
- data/KGrift/knewton_grifts/registration_grifts.rb +159 -0
- data/KGrift/knewton_grifts/registration_info_grifts.rb +23 -0
- data/KGrift/knewton_grifts/report_grifts.rb +122 -0
- data/KGrift/knewton_grifts/shell_command_grifts.rb +21 -0
- data/KGrift/knewton_grifts/student_flow_grifts.rb +560 -0
- data/KGrift/knewton_grifts/tag_grifts.rb +41 -0
- data/KGrift/knewton_grifts/test_data_grifts.rb +328 -0
- data/KGrift/knewton_grifts/test_user_grifts.rb +264 -0
- data/KGrift/lib/dtrace.rb +20 -0
- data/KGrift/lib/kgrift.rb +7 -0
- data/KGrift/test_data_generators/basic_book_and_taxonomies.rb +35 -0
- data/KGrift/test_data_generators/lo_test_graph.rb +34 -0
- data/KGrift/test_data_generators/partner_owned_book_and_taxonomies.rb +28 -0
- data/KGrift/test_data_generators/partner_owned_book_and_taxonomies_unicode.rb +28 -0
- data/KGrift/test_data_generators/sandcastle_book_and_taxonomies.rb +13 -0
- data/KGrift/test_data_generators/sandcastle_book_and_taxonomies.yml +3709 -0
- data/KGrift/test_data_generators/sandcastle_graph.rb +8 -0
- data/KGrift/test_data_generators/sandcastle_graph_definition.json +4483 -0
- data/KGrift/test_data_generators/sandcastle_graph_full.rb +7 -0
- data/KGrift/test_data_generators/sandcastle_taxonomies.yml +378 -0
- data/KGrift/test_data_generators/sandcastle_with_taxons.rb +56 -0
- data/KGrift/test_data_generators/sandcastle_with_taxons.yml +3994 -0
- data/KGrift/test_data_generators/test_users_and_partners.rb +76 -0
- data/kgrift.gemspec +43 -0
- metadata +144 -0
@@ -0,0 +1,76 @@
|
|
1
|
+
wait_for_api_to_respond
|
2
|
+
|
3
|
+
test_knerd_credentials = knerd_accounts['knerd']
|
4
|
+
|
5
|
+
#make sure we can login, and stop immediately if we can not
|
6
|
+
begin
|
7
|
+
set_account test_knerd_credentials
|
8
|
+
rescue Exception => e
|
9
|
+
Kernel.abort "ERROR: Failed to login using knewton partner that should just be there:\n#{e.to_s}"
|
10
|
+
end
|
11
|
+
|
12
|
+
accounts = {
|
13
|
+
'system_user_default' => {'client'=>'test_partner_default'},
|
14
|
+
'system_user_a' => {'client'=>'test_partner_a'},
|
15
|
+
'system_user_b' => {'client'=>'test_partner_b'},
|
16
|
+
'user_default' => {'client'=>'test_partner_default'},
|
17
|
+
'user_a' => {'client'=>'test_partner_a'},
|
18
|
+
'user_b' => {'client'=>'test_partner_b'},
|
19
|
+
}
|
20
|
+
partners = {
|
21
|
+
'test_partner_default' => {},
|
22
|
+
'test_partner_a' => {},
|
23
|
+
'test_partner_b' => {},
|
24
|
+
}
|
25
|
+
|
26
|
+
#add test partners
|
27
|
+
partners.each_pair do |client_label, client_data|
|
28
|
+
password = random_string
|
29
|
+
|
30
|
+
# make the partner with a high rate_limit_multiplier to avoid any
|
31
|
+
# token based rate limit issues with these test partners
|
32
|
+
# rate limits are tested with different partners
|
33
|
+
credentials = create_partner 'password' => password,
|
34
|
+
'display_name' => "#{client_label} #{random_string(8)}",
|
35
|
+
'rate_limit_multiplier' => 100.0
|
36
|
+
|
37
|
+
full_credentials = {
|
38
|
+
'client_id' => credentials['name'],
|
39
|
+
'client_secret' => password,
|
40
|
+
'partner_id' => credentials['id'],
|
41
|
+
}
|
42
|
+
client_data.merge! full_credentials
|
43
|
+
end
|
44
|
+
|
45
|
+
#add system accounts
|
46
|
+
accounts.select{|k,v| k.start_with? 'system_user'}.each_pair do |account_label, account_data|
|
47
|
+
partner = partners[accounts[account_label]['client']]
|
48
|
+
account_data['client_credentials'] = {
|
49
|
+
'client_id' => partner['client_id'],
|
50
|
+
'client_secret' => partner['client_secret'],
|
51
|
+
}
|
52
|
+
account_data['external_user_id'] = (create_system_user partner['partner_id'])['external_user_id']
|
53
|
+
end
|
54
|
+
|
55
|
+
#add regular user accounts
|
56
|
+
accounts.select{|k,v| k.start_with? 'user'}.each_pair do |account_label, account_data|
|
57
|
+
partner = partners[accounts[account_label]['client']]
|
58
|
+
system_user = accounts.select{|k,v| v['client']==account_data['client'] and
|
59
|
+
k.start_with?('system_user')}.map{|k,v| v}.first
|
60
|
+
#create users as a partner system user
|
61
|
+
as_account system_user['external_user_id'], system_user['client_credentials'] do
|
62
|
+
account_data['client_credentials'] = {
|
63
|
+
'client_id' => partner['client_id'],
|
64
|
+
'client_secret' => partner['client_secret'],
|
65
|
+
}
|
66
|
+
account_data['external_user_id'] = (create_account)['external_user_id']
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
unauthenticate
|
71
|
+
|
72
|
+
#return all accounts and partners
|
73
|
+
{
|
74
|
+
'accounts' => accounts,
|
75
|
+
'partners' => partners,
|
76
|
+
}
|
data/kgrift.gemspec
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
|
2
|
+
Gem::Specification.new do |s|
|
3
|
+
|
4
|
+
s.name = 'kgrift'
|
5
|
+
|
6
|
+
# define the version of the gem
|
7
|
+
# Major and Minor are incremented manually when appropriate
|
8
|
+
# Patch version is taken from jenkins BUILD_NUMBER env var, which should continuously increment
|
9
|
+
major = '1'
|
10
|
+
minor = '3'
|
11
|
+
patch = ENV.fetch 'BUILD_NUMBER', '1'
|
12
|
+
s.version = "#{major}.#{minor}.#{patch}"
|
13
|
+
|
14
|
+
s.description = "Interact with the Knewton Enterprise API through a DSL."
|
15
|
+
s.homepage = "https://confluence.knewton.net/display/TECH/kgrift"
|
16
|
+
|
17
|
+
s.licenses = ['Dont distribute anywhere external']
|
18
|
+
s.summary = "A grifter based API client for Knewton internal use"
|
19
|
+
s.description = "A grifter based API client for Knewton internal use. includes a DSL which can be used in programs, scripts, or right off the cmd line using the included 'kgrift' utility"
|
20
|
+
s.homepage = 'https://knewton.atlassian.net/wiki/display/TECH/kgrift'
|
21
|
+
s.authors = ["Rob Schultheis", "Alan Gerber"]
|
22
|
+
s.email = 'rob@knewton.com'
|
23
|
+
|
24
|
+
s.files = [
|
25
|
+
'kgrift.gemspec',
|
26
|
+
'KGrift/grifter.yml',
|
27
|
+
'KGrift/Gemfile',
|
28
|
+
'KGrift/README.md',
|
29
|
+
] +
|
30
|
+
Dir['KGrift/bin/**/*'] +
|
31
|
+
Dir['KGrift/lib/**/*'] +
|
32
|
+
Dir['KGrift/knewton_grifts/**/*'] +
|
33
|
+
Dir['KGrift/test_data_generators/**/*'] +
|
34
|
+
Dir['KGrift/internal_test_graphs/*.yml']
|
35
|
+
|
36
|
+
s.bindir = 'KGrift/bin'
|
37
|
+
s.executables << 'kgrift'
|
38
|
+
s.require_paths = ['KGrift/lib']
|
39
|
+
|
40
|
+
s.add_runtime_dependency 'grifter', '= 0.4.2'
|
41
|
+
s.add_runtime_dependency 'aws-sdk', '= 2.0.26'
|
42
|
+
s.add_runtime_dependency 'activesupport', '= 3.2.13'
|
43
|
+
end
|
metadata
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kgrift
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.3.108
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rob Schultheis
|
8
|
+
- Alan Gerber
|
9
|
+
autorequire:
|
10
|
+
bindir: KGrift/bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2016-01-21 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: grifter
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - '='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 0.4.2
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - '='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 0.4.2
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: aws-sdk
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - '='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 2.0.26
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - '='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 2.0.26
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: activesupport
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - '='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 3.2.13
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - '='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 3.2.13
|
56
|
+
description: A grifter based API client for Knewton internal use. includes a DSL
|
57
|
+
which can be used in programs, scripts, or right off the cmd line using the included
|
58
|
+
'kgrift' utility
|
59
|
+
email: rob@knewton.com
|
60
|
+
executables:
|
61
|
+
- kgrift
|
62
|
+
extensions: []
|
63
|
+
extra_rdoc_files: []
|
64
|
+
files:
|
65
|
+
- KGrift/Gemfile
|
66
|
+
- KGrift/README.md
|
67
|
+
- KGrift/bin/kgrift
|
68
|
+
- KGrift/grifter.yml
|
69
|
+
- KGrift/internal_test_graphs/basic_test_graph_definition.yml
|
70
|
+
- KGrift/internal_test_graphs/unicode_test_graph_definition.yml
|
71
|
+
- KGrift/knewton_grifts/analytics_grifts.rb
|
72
|
+
- KGrift/knewton_grifts/async_helper_grifts.rb
|
73
|
+
- KGrift/knewton_grifts/authenticator_grifts.rb
|
74
|
+
- KGrift/knewton_grifts/basic_grifts.rb
|
75
|
+
- KGrift/knewton_grifts/batch_grifts.rb
|
76
|
+
- KGrift/knewton_grifts/content_collection_grifts.rb
|
77
|
+
- KGrift/knewton_grifts/content_collection_v1_grifts.rb
|
78
|
+
- KGrift/knewton_grifts/content_eid_grifts.rb
|
79
|
+
- KGrift/knewton_grifts/copy_grifts.rb
|
80
|
+
- KGrift/knewton_grifts/deprecated_graph_and_taxonomy_grifts.rb
|
81
|
+
- KGrift/knewton_grifts/goal_grifts.rb
|
82
|
+
- KGrift/knewton_grifts/graph_and_taxonomy_grifts.rb
|
83
|
+
- KGrift/knewton_grifts/graph_create_grifts.rb
|
84
|
+
- KGrift/knewton_grifts/graph_query_grifts.rb
|
85
|
+
- KGrift/knewton_grifts/graph_tools_grifts.rb
|
86
|
+
- KGrift/knewton_grifts/graph_validation_grifts.rb
|
87
|
+
- KGrift/knewton_grifts/helper_grifts.rb
|
88
|
+
- KGrift/knewton_grifts/jmeter_data_grifts.rb
|
89
|
+
- KGrift/knewton_grifts/learning_instance_grifts.rb
|
90
|
+
- KGrift/knewton_grifts/looper_grifts.rb
|
91
|
+
- KGrift/knewton_grifts/moxy_grifts.rb
|
92
|
+
- KGrift/knewton_grifts/oauth_grifts.rb
|
93
|
+
- KGrift/knewton_grifts/partner_grifts.rb
|
94
|
+
- KGrift/knewton_grifts/partner_support_grifts.rb
|
95
|
+
- KGrift/knewton_grifts/recommendation_setup_grifts.rb
|
96
|
+
- KGrift/knewton_grifts/registration_grifts.rb
|
97
|
+
- KGrift/knewton_grifts/registration_info_grifts.rb
|
98
|
+
- KGrift/knewton_grifts/report_grifts.rb
|
99
|
+
- KGrift/knewton_grifts/shell_command_grifts.rb
|
100
|
+
- KGrift/knewton_grifts/student_flow_grifts.rb
|
101
|
+
- KGrift/knewton_grifts/tag_grifts.rb
|
102
|
+
- KGrift/knewton_grifts/test_data_grifts.rb
|
103
|
+
- KGrift/knewton_grifts/test_user_grifts.rb
|
104
|
+
- KGrift/lib/dtrace.rb
|
105
|
+
- KGrift/lib/kgrift.rb
|
106
|
+
- KGrift/test_data_generators/basic_book_and_taxonomies.rb
|
107
|
+
- KGrift/test_data_generators/lo_test_graph.rb
|
108
|
+
- KGrift/test_data_generators/partner_owned_book_and_taxonomies.rb
|
109
|
+
- KGrift/test_data_generators/partner_owned_book_and_taxonomies_unicode.rb
|
110
|
+
- KGrift/test_data_generators/sandcastle_book_and_taxonomies.rb
|
111
|
+
- KGrift/test_data_generators/sandcastle_book_and_taxonomies.yml
|
112
|
+
- KGrift/test_data_generators/sandcastle_graph.rb
|
113
|
+
- KGrift/test_data_generators/sandcastle_graph_definition.json
|
114
|
+
- KGrift/test_data_generators/sandcastle_graph_full.rb
|
115
|
+
- KGrift/test_data_generators/sandcastle_taxonomies.yml
|
116
|
+
- KGrift/test_data_generators/sandcastle_with_taxons.rb
|
117
|
+
- KGrift/test_data_generators/sandcastle_with_taxons.yml
|
118
|
+
- KGrift/test_data_generators/test_users_and_partners.rb
|
119
|
+
- kgrift.gemspec
|
120
|
+
homepage: https://knewton.atlassian.net/wiki/display/TECH/kgrift
|
121
|
+
licenses:
|
122
|
+
- Dont distribute anywhere external
|
123
|
+
metadata: {}
|
124
|
+
post_install_message:
|
125
|
+
rdoc_options: []
|
126
|
+
require_paths:
|
127
|
+
- KGrift/lib
|
128
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
requirements: []
|
139
|
+
rubyforge_project:
|
140
|
+
rubygems_version: 2.4.5
|
141
|
+
signing_key:
|
142
|
+
specification_version: 4
|
143
|
+
summary: A grifter based API client for Knewton internal use
|
144
|
+
test_files: []
|