propel_api 0.2.0 → 0.2.1

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -37
  3. data/lib/propel_api.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fda016a4637d6921f4cbd7c1739aa12b652453b68f2bf00e627adda7a0384086
4
- data.tar.gz: bee75517d7fee3d5f04536be44f5dba602bc5525076814a87e7b6f743a467913
3
+ metadata.gz: 8fb51b38b12561c709712a339a39cf3639cd1e8a16149f72c00f1566ee37bdcf
4
+ data.tar.gz: a90352463962e6385b895cf339195b6860f0d5e98ccf1c4e6e3237957f6895cf
5
5
  SHA512:
6
- metadata.gz: a19fc6c6f6c4d12773081adc7a856d7f4fcb1977c56cb3686334d8e316bb29ef540829f0f25adcd61ae6285f10a010691f063b0003bad463bc8b8624afd05974
7
- data.tar.gz: 65349f86faa2e171c64b20d6699f90dc56649ae1b8c888f64ac8c3b76f147bbd301689ac79a0032c71cc134e3d1c3e380f0f5a1fbb7a35c46ea0adaebd63fb44
6
+ metadata.gz: a2d01e1bcc8f7a749e8de4101d6f7be9dc5c4a7b2b0f2b7d5dc78e630dbba0102cedee82ff957cd210bde487a66c0b936a546b50c75f38e45db84dabcc74e6d0
7
+ data.tar.gz: 94dad0a33d4fd5af9327d42b21faa0a69bcdd7a018d914293db3643e68496b4b4f979d99cb14f8683b0df3040f6f15b55b6c4ff47c72015da9eaf6d336d5fb83
data/CHANGELOG.md CHANGED
@@ -10,19 +10,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
  ### Planned Features
11
11
  - GraphQL adapter support
12
12
 
13
- ## [0.2.0] - 2025-09-02
13
+ ## [0.2.1] - 2025-01-14
14
+
15
+ ### Fixed
16
+ - **Dependency update**: Improved compatibility with PropelFacets 0.2.1
17
+ - API controllers now work correctly with fixed `for_organization` scope installation
18
+ - Resolves `NoMethodError` when using generated controllers in fresh Rails installations
14
19
 
15
- ### BREAKING CHANGES
16
- - **Security-first API architecture**: Complete redesign of tenancy validation flow
17
- - Invalid tenancy context (organization_id, agency_id) now returns 403 Forbidden instead of 422 Unprocessable Entity
18
- - Security validation occurs before business validation (prevents information disclosure)
19
- - Error response structure changed from `{"errors": {...}}` to `{"error": "...", "message": "...", "code": "..."}`
20
- - **Controller generation format**: Generated controllers now use foreign key format in permitted_params
21
- - `permitted_params :organization` → `permitted_params :organization_id`
22
- - Ensures proper strong parameter filtering for security validation
23
- - **Configuration dependency**: `agency_tenancy` configuration moved to PropelAuthentication
24
- - Remove `PropelApi.configuration.agency_tenancy` from config files
25
- - Agency tenancy now controlled entirely by PropelAuthentication
20
+ ## [0.2.0] - 2025-09-02
26
21
 
27
22
  ### Added
28
23
  - **Organization-level multi-tenancy security** - Complete data isolation between organizations
@@ -31,19 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
31
26
  - `for_organization(org_id)` scope added to ApplicationRecord base class
32
27
  - Cross-organization data access completely blocked (show, update, delete return 404)
33
28
  - New records automatically assigned to authenticated user's organization
34
- - Comprehensive security test suite covering all attack vectors
29
+ - Comprehensive security test suite with 12 tests covering all attack vectors
35
30
  - Zero impact on existing single-tenant applications
36
- - **Configurable auto-assignment**: Integration with PropelAuthentication tenancy configuration
37
- - Respects `require_organization_id` and `require_user_id` settings from PropelAuthentication
38
- - Helper methods: `require_organization_id?`, `require_user_id?` for configuration access
39
- - **Enhanced security validation**: Comprehensive unauthorized access protection
40
- - Organization access validation with detailed error codes
41
- - User assignment validation for admin delegation scenarios
42
- - Agency access validation with proper user permission checking
43
- - **Conditional test generation**: Tests now adapt behavior based on PropelAuthentication configuration
44
- - Auto-assignment mode: Tests expect 201 Created with proper context assignment
45
- - Strict mode: Tests expect 422 Unprocessable Entity when required fields missing
46
- - Security tests: Tests expect 403 Forbidden for unauthorized access attempts
47
31
 
48
32
  ### Fixed
49
33
  - **Authentication namespace conflict resolved** - Renamed authentication concern to prevent module name collision
@@ -53,14 +37,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
53
37
  - Updated PropelFacets and Graphiti API controller templates
54
38
  - Improved method visibility: `authenticate_user`, `current_user`, and `extract_jwt_token` are now public methods
55
39
  - Enhanced flexibility for custom authentication scenarios (email notifications, audit logging, token refresh)
56
- - **Attribute introspection**: Fixed foreign key detection for User and other models with associations
57
- - Database column introspection now properly generates foreign key format for permitted_params
58
- - Association detection preserved for model relationship generation
59
- - JSON field handling improved with proper `field: {}` syntax for nested objects
60
- - **Test data generation**: Enhanced User model test data generation
61
- - Unique email and username generation to prevent fixture conflicts
62
- - Proper field names for User model tests (email_address, username, password vs generic title)
63
- - Model-specific test data patterns for comprehensive validation coverage
64
40
 
65
41
  ### Security
66
42
  - **Multi-tenant data isolation** - Zero-trust organization scoping prevents data leaks
@@ -71,17 +47,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
71
47
  - Database-level enforcement via ActiveRecord scopes
72
48
 
73
49
  ### Improved
74
- - **Multi-step security validation**: Three-phase validation for robust security
75
- 1. Security validation (403 for unauthorized access)
76
- 2. Auto-assignment (based on configuration)
77
- 3. Final validation (422 for missing required fields)
78
50
  - **Authentication concern API design** - Better method organization and access patterns
79
51
  - `authenticate_user` - Public method for `before_action` callbacks
80
52
  - `current_user` - Public method for accessing authenticated user
81
53
  - `current_organization_id` - Public method for accessing organization context
82
54
  - `extract_jwt_token` - Public method for custom authentication scenarios
83
55
  - Clean separation between public API and internal implementation
84
- - **Template reliability**: Attribute detection using generator attributes instead of database queries during generation
85
56
 
86
57
  ## [0.1.4] - 2025-08-15
87
58
 
data/lib/propel_api.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module PropelApi
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: propel_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Martin, Rafael Pivato, Chi Putera