-
Notifications
You must be signed in to change notification settings - Fork 122
Feat/base64 base64url #924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis pull request expands the encoding capabilities by introducing two new predicates, Base64URL and Base64, within the encoding module. The changes include adding a new registry entry for the "base64url/2" predicate, implementing the corresponding predicate functions in the encoding file, and updating related documentation. Additionally, feature tests for both "base64/2" and "base64url/2" predicates have been added to verify correct encoding and decoding behaviors. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant I as Interpreter
participant R as Registry
participant P as Predicate Function
U->>I: Submit query with "base64url/2" predicate
I->>R: Lookup "base64url/2" entry
R-->>I: Return Base64URL function reference
I->>P: Execute Base64URL with provided input
P-->>I: Return encoded/decoded result
I->>U: Return final query result
Possibly related PRs
Suggested reviewers
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (28)
docs/predicate/base64_2.md
is excluded by!docs/predicate/**/*.md
docs/predicate/base64_encoded_3.md
is excluded by!docs/predicate/**/*.md
docs/predicate/base64_url_2.md
is excluded by!docs/predicate/**/*.md
docs/predicate/bech32_address_2.md
is excluded by!docs/predicate/**/*.md
docs/predicate/block_header_1.md
is excluded by!docs/predicate/**/*.md
docs/predicate/block_height_1.md
is excluded by!docs/predicate/**/*.md
docs/predicate/block_time_1.md
is excluded by!docs/predicate/**/*.md
docs/predicate/chain_id_1.md
is excluded by!docs/predicate/**/*.md
docs/predicate/consult_1.md
is excluded by!docs/predicate/**/*.md
docs/predicate/crypto_data_hash_3.md
is excluded by!docs/predicate/**/*.md
docs/predicate/current_output_1.md
is excluded by!docs/predicate/**/*.md
docs/predicate/did_components_2.md
is excluded by!docs/predicate/**/*.md
docs/predicate/ecdsa_verify_4.md
is excluded by!docs/predicate/**/*.md
docs/predicate/eddsa_verify_4.md
is excluded by!docs/predicate/**/*.md
docs/predicate/hex_bytes_2.md
is excluded by!docs/predicate/**/*.md
docs/predicate/json_prolog_2.md
is excluded by!docs/predicate/**/*.md
docs/predicate/json_read_2.md
is excluded by!docs/predicate/**/*.md
docs/predicate/json_write_2.md
is excluded by!docs/predicate/**/*.md
docs/predicate/open_3.md
is excluded by!docs/predicate/**/*.md
docs/predicate/open_4.md
is excluded by!docs/predicate/**/*.md
docs/predicate/read_string_3.md
is excluded by!docs/predicate/**/*.md
docs/predicate/read_term_3.md
is excluded by!docs/predicate/**/*.md
docs/predicate/retract_1.md
is excluded by!docs/predicate/**/*.md
docs/predicate/source_file_1.md
is excluded by!docs/predicate/**/*.md
docs/predicate/string_bytes_3.md
is excluded by!docs/predicate/**/*.md
docs/predicate/term_to_atom_2.md
is excluded by!docs/predicate/**/*.md
docs/predicate/uri_encoded_3.md
is excluded by!docs/predicate/**/*.md
docs/predicate/write_term_3.md
is excluded by!docs/predicate/**/*.md
📒 Files selected for processing (4)
x/logic/interpreter/registry.go
(1 hunks)x/logic/predicate/encoding.go
(3 hunks)x/logic/predicate/features/base64_2.feature
(1 hunks)x/logic/predicate/features/base64url_2.feature
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.go`: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.
x/logic/interpreter/registry.go
x/logic/predicate/encoding.go
🧬 Code Definitions (2)
x/logic/interpreter/registry.go (1)
x/logic/predicate/encoding.go (1)
Base64URL
(163-170)
x/logic/predicate/encoding.go (1)
x/logic/prolog/atom.go (7)
AtomAs
(7-7)AtomEncoding
(19-19)AtomUtf8
(57-57)AtomCharset
(37-37)AtomPadding
(35-35)AtomFalse
(23-23)AtomTrue
(55-55)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: test-go
- GitHub Check: lint-generated
- GitHub Check: analyze-go
- GitHub Check: lint-go
- GitHub Check: build-docker
🔇 Additional comments (3)
x/logic/predicate/features/base64url_2.feature (1)
1-28
: LGTM: Appropriate test for base64url/2The test case correctly demonstrates URL-safe Base64 encoding and decoding with the non-padded output format. The chosen test string
<<???>>
appropriately shows URL-safe character replacements.x/logic/predicate/encoding.go (2)
149-170
: LGTM: Well-implemented Base64URL functionThe implementation correctly configures the Base64Encoded function with URL-safe encoding parameters (charset=url, padding=false) for use in URLs and filenames.
172-193
: LGTM: Well-implemented Base64 functionThe implementation correctly configures the Base64Encoded function with standard encoding parameters (charset=classic, padding=true) for regular Base64 encoding/decoding.
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## main #924 +/- ##
==========================================
+ Coverage 38.58% 38.72% +0.13%
==========================================
Files 113 113
Lines 6476 6490 +14
==========================================
+ Hits 2499 2513 +14
Misses 3857 3857
Partials 120 120
🚀 New features to boost your workflow:
|
e29cd56
to
8bdc625
Compare
@coderabbitai resolve |
✅ Actions performedComments resolved and changes approved. |
Following #921, this PR introduces the convenient
base64/2
andbase64url/2
predicates to thelogic
module.These are simplified forms of base64_encoded/3, preconfigured with common options for standard and URL-safe encoding.
Summary by CodeRabbit
New Features
Tests