ctws 0.2.1.beta → 0.2.2.beta
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 +4 -4
- data/README.md +4 -1
- data/app/controllers/concerns/ctws/exception_handler.rb +5 -5
- data/config/locales/ctws_messages_fr.yml +15 -0
- data/lib/ctws/version.rb +7 -2
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +31496 -0
- metadata +54 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '083ac80582de8e764c98b760ea9ffb4c3b7a5aa8'
|
4
|
+
data.tar.gz: ddc0b98596ebde39a03d3ecd4a65de15ada9d526
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32695b8f7a7cdcf786914fab6b50ffe3c1c897ac323c6ef9e88b7596a67126705ad411094358165d398cdff95efeb7e8ab7b8d862101a5334770e8f60ce25e04
|
7
|
+
data.tar.gz: 02a035082f6809803755b25ca1649ec6d0bb6e5777dd38a108996b496f5fabdb0d0e2227c41791fc3dd385ddef1c07a7bea245f0523b5dbd0f2a037a0f9b8101
|
data/README.md
CHANGED
@@ -4,7 +4,10 @@
|
|
4
4
|
|
5
5
|
Rails gem to be used as Webservice RESTful JSON API with Rails 5.
|
6
6
|
|
7
|
-
|
7
|
+
Features:
|
8
|
+
- `MinAppVersion` and `User` resources
|
9
|
+
- token based authentication [JSON Web Tokens](https://jwt.io/).
|
10
|
+
- Json Api
|
8
11
|
|
9
12
|
## Installation
|
10
13
|
Add this line to your application's Gemfile:
|
@@ -40,26 +40,26 @@ module Ctws
|
|
40
40
|
|
41
41
|
# JSON response with message; Status code 401 - Unauthorized
|
42
42
|
def unauthorized_request(e)
|
43
|
-
json_response([{ message: e.message, error_code:
|
43
|
+
json_response([{ message: e.message, error_code: 401}], :unauthorized)
|
44
44
|
end
|
45
45
|
|
46
46
|
# JSON response with message; Status code 404 - Not Found
|
47
47
|
def not_found(e)
|
48
|
-
json_response([{ message: e.message, error_code:
|
48
|
+
json_response([{ message: e.message, error_code: 404 }], :not_found)
|
49
49
|
end
|
50
50
|
|
51
51
|
def not_confirmed(e)
|
52
|
-
json_response([{ message: e.message, error_code:
|
52
|
+
json_response([{ message: e.message, error_code: 403 }], :unauthorized)
|
53
53
|
end
|
54
54
|
|
55
55
|
# JSON response with message; Status code 422 - unprocessable entity
|
56
56
|
def four_twenty_two(e)
|
57
|
-
json_response([{ message: e.message, error_code:
|
57
|
+
json_response([{ message: e.message, error_code: 422 }], :unprocessable_entity)
|
58
58
|
end
|
59
59
|
|
60
60
|
# JSON response with message; Status code 498 - Invalid Token
|
61
61
|
def four_ninety_eight(e)
|
62
|
-
json_response([{ message: e.message, error_code:
|
62
|
+
json_response([{ message: e.message, error_code: 498 }], :invalid_token)
|
63
63
|
end
|
64
64
|
|
65
65
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
fr:
|
2
|
+
ctws:
|
3
|
+
authenticated_user_success: "%{resource} authentifiée avec succès."
|
4
|
+
expired_token: "Désolé, votre token a expiré. Veuillez vous connecter pour continuer."
|
5
|
+
invalid_credentials: "Identifiants invalides."
|
6
|
+
invalid_token: "Token invalide."
|
7
|
+
missing_token: "Token manquant."
|
8
|
+
not_found: "%{record} non trouvé."
|
9
|
+
record_not_confirmed: "%{record} non confirmé."
|
10
|
+
resource_created: "%{resource} créée avec succès."
|
11
|
+
resource_doesnt_exist: "%{resource} n'existe pas."
|
12
|
+
resource_not_created: "%{resource} n'a pas pu être créée."
|
13
|
+
resource_updated: "%{resource} créée avec succès."
|
14
|
+
unauthorized: "Requête non autorisée."
|
15
|
+
unmatched_route: "Aucune route ne coïncide avec %{route}."
|
data/lib/ctws/version.rb
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
module Ctws
|
2
2
|
# Under development: BETA
|
3
3
|
|
4
|
-
VERSION = '0.2.
|
5
|
-
|
4
|
+
VERSION = '0.2.2.beta'
|
5
|
+
|
6
|
+
# PATCH - 0.2.2.beta - 14/5/2018
|
7
|
+
# [ADDED] Add fr locale.
|
8
|
+
# [REFACTOR] Return error_codes as integers instead of strings.
|
9
|
+
|
10
|
+
# PATCH - 0.2.1.beta - 06/4/2018
|
6
11
|
# [FEATURE] Add exception handler for ArgumentError.
|
7
12
|
end
|
Binary file
|