minty-rails 1.0.3

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d06985a0e301e7e83863d74890539da24d38f1fecc64b947cbcdabf95192136a
4
+ data.tar.gz: f910bf2871e51821da79e55eeb461080bec94ac094f35bca6ff26c53b26d44c7
5
+ SHA512:
6
+ metadata.gz: cfad9835712d38feba02cfd65e35207c336a58d07f65b1d2670a091a1cf0103e770852c7594991fd78d64676fe0350cf225daf93ec351e0a5f3c9f2b09936b86
7
+ data.tar.gz: 04f1eeedf7009de9652523ef168f6d1bb8d30a9a70ca2bafb4eb265f3bd282296185da5985d04e9cdac6c0a28b871a140764632710be3565ad282cadbb78259a
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2022 Minty
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,69 @@
1
+ Ruby API client for the [Minty](https://minty.page) platform.
2
+
3
+ [![MIT licensed](https://img.shields.io/dub/l/vibe-d.svg?style=flat)](https://github.com/mintypage/ruby/blob/master/LICENSE)
4
+
5
+ ## Installation
6
+ Add this line to your application's Gemfile:
7
+
8
+ ```ruby
9
+ gem "minty-rails"
10
+ ```
11
+
12
+ And then execute:
13
+ ```bash
14
+ $ bundle
15
+ ```
16
+
17
+ ## Initializer
18
+ ```ruby
19
+ Minty::Rails.configure do |config|
20
+ config.client_id = "copy-paste-client-id-here"
21
+ config.client_secret = "copy-paste-client-secret-here"
22
+ config.application_id = "copy-paste-application-id-here"
23
+ config.domain = "copy-paste-domain-here"
24
+
25
+ config.sign_in_path = "/users/sign_in"
26
+ config.sign_up_path = "/users/sign_up"
27
+ config.forgot_password_path = "/users/forgot_password"
28
+ end
29
+ ```
30
+
31
+ ## Use the ruby client programatically
32
+
33
+ Create an instance of `MintyClient` to access properties and methods of the authentication and management APIs:
34
+
35
+ ```ruby
36
+ require 'minty'
37
+
38
+ client = MintyClient.new(
39
+ client_id: ENV['CLIENT_ID'],
40
+ client_secret: ENV['CLIENT_SECRET'],
41
+ application_id: ENV['APPLICATION_ID'],
42
+ domain: ENV['DOMAIN'],
43
+ )
44
+ ```
45
+
46
+ Or install it yourself as:
47
+ ```bash
48
+ $ gem install minty-rails
49
+ ```
50
+
51
+ ## Feedback
52
+
53
+ ### Contributing
54
+
55
+ We appreciate feedback and contribution to this repo! Before you get started, please see the following:
56
+
57
+ - [Minty's general contribution guidelines](https://github.com/minty/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
58
+ - [Minty's code of conduct guidelines](https://github.com/minty/open-source-template/blob/master/CODE-OF-CONDUCT.md)
59
+
60
+ ### Raise an issue
61
+
62
+ To provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/mintypage/ruby/issues).
63
+
64
+ ### Vulnerability Reporting
65
+
66
+ Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://minty.page/whitehat) details the procedure for disclosing security issues.
67
+
68
+ ## License
69
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "bundler/setup"
2
+
3
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
4
+ load "rails/tasks/engine.rake"
5
+
6
+ load "rails/tasks/statistics.rake"
7
+
8
+ require "bundler/gem_tasks"
@@ -0,0 +1 @@
1
+ //= link_directory ../stylesheets/minty/rails .css
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,6 @@
1
+ module Minty
2
+ module Rails
3
+ class ApplicationController < ActionController::Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,28 @@
1
+ require 'minty'
2
+
3
+ module Minty::Rails
4
+ class SessionController < ApplicationController
5
+ def sign_in_url
6
+ redirect_to minty_client.sign_in_url, allow_other_host: true
7
+ end
8
+
9
+ def sign_up_url
10
+ redirect_to minty_client.sign_up_url, allow_other_host: true
11
+ end
12
+
13
+ def forgot_password_url
14
+ redirect_to minty_client.forgot_password_url, allow_other_host: true
15
+ end
16
+
17
+ private
18
+
19
+ def minty_client
20
+ @minty_client ||= MintyClient.new(
21
+ client_id: Minty::Rails.configuration.client_id,
22
+ client_secret: Minty::Rails.configuration.client_secret,
23
+ application_id: Minty::Rails.configuration.application_id,
24
+ domain: Minty::Rails.configuration.domain,
25
+ )
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,6 @@
1
+ module Minty
2
+ module Rails
3
+ module ApplicationHelper
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,4 @@
1
+ module Minty::Rails
2
+ module SessionHelper
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module Minty
2
+ module Rails
3
+ class ApplicationJob < ActiveJob::Base
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ module Minty
2
+ module Rails
3
+ class ApplicationMailer < ActionMailer::Base
4
+ default from: "from@example.com"
5
+ layout "mailer"
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ module Minty
2
+ module Rails
3
+ class ApplicationRecord < ActiveRecord::Base
4
+ self.abstract_class = true
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Minty rails</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+
8
+ <%= stylesheet_link_tag "minty/rails/application", media: "all" %>
9
+ </head>
10
+ <body>
11
+
12
+ <%= yield %>
13
+
14
+ </body>
15
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,5 @@
1
+ Minty::Rails::Engine.routes.draw do
2
+ get Minty::Rails.configuration.sign_in_path => 'session#sign_in_url'
3
+ get Minty::Rails.configuration.sign_up_path => 'session#sign_up_url'
4
+ get Minty::Rails.configuration.forgot_password_path => 'session#forgot_password_url'
5
+ end
@@ -0,0 +1,13 @@
1
+ module Minty
2
+ module Rails
3
+ class Configuration
4
+ attr_accessor :sign_in_path,
5
+ :sign_up_path,
6
+ :forgot_password_path,
7
+ :client_id,
8
+ :client_secret,
9
+ :application_id,
10
+ :domain
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ module Minty
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ isolate_namespace Minty::Rails
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module Minty
2
+ module Rails
3
+ VERSION = "1.0.3"
4
+ end
5
+ end
@@ -0,0 +1,15 @@
1
+ require "minty/rails/version"
2
+ require "minty/rails/engine"
3
+ require "minty/rails/configuration"
4
+
5
+ module Minty
6
+ module Rails
7
+ def self.configuration
8
+ @configuration ||= Configuration.new
9
+ end
10
+
11
+ def self.configure(&block)
12
+ yield(configuration)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :minty_rails do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: minty-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Minty
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-11-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: minty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.0.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.1
33
+ - !ruby/object:Gem::Dependency
34
+ name: rails
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '7.0'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 7.0.4
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '7.0'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 7.0.4
53
+ description: Ruby toolkit for Minty API https://minty.page
54
+ email:
55
+ - support@minty.page
56
+ executables: []
57
+ extensions: []
58
+ extra_rdoc_files: []
59
+ files:
60
+ - MIT-LICENSE
61
+ - README.md
62
+ - Rakefile
63
+ - app/assets/config/minty_rails_manifest.js
64
+ - app/assets/stylesheets/minty/rails/application.css
65
+ - app/controllers/minty/rails/application_controller.rb
66
+ - app/controllers/minty/rails/session_controller.rb
67
+ - app/helpers/minty/rails/application_helper.rb
68
+ - app/helpers/minty/rails/session_helper.rb
69
+ - app/jobs/minty/rails/application_job.rb
70
+ - app/mailers/minty/rails/application_mailer.rb
71
+ - app/models/minty/rails/application_record.rb
72
+ - app/views/layouts/minty/rails/application.html.erb
73
+ - config/routes.rb
74
+ - lib/minty/rails.rb
75
+ - lib/minty/rails/configuration.rb
76
+ - lib/minty/rails/engine.rb
77
+ - lib/minty/rails/version.rb
78
+ - lib/tasks/minty/rails_tasks.rake
79
+ homepage: https://github.com/mintypage/minty-rails
80
+ licenses:
81
+ - MIT
82
+ metadata:
83
+ homepage_uri: https://github.com/mintypage/minty-rails
84
+ source_code_uri: https://github.com/mintypage/minty-rails
85
+ changelog_uri: https://github.com/mintypage/minty-rails
86
+ post_install_message:
87
+ rdoc_options: []
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubygems_version: 3.1.6
102
+ signing_key:
103
+ specification_version: 4
104
+ summary: Minty Rails Gem
105
+ test_files: []