-
Notifications
You must be signed in to change notification settings - Fork 2
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
CSPR.cloud auth token support. #474
Conversation
WalkthroughThe latest update from version Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant .env.sample
participant CasperClient
participant CSPR.cloud
User->>.env.sample: Add CSPR_CLOUD_AUTH_TOKEN
User->>CasperClient: Initialize with auth token
CasperClient->>CSPR.cloud: Send request with auth token
CSPR.cloud-->>CasperClient: Authenticated response
CasperClient-->>User: Processed response
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- CHANGELOG.md (1 hunks)
- examples/.env.sample (2 hunks)
- odra-casper/rpc-client/src/casper_client.rs (4 hunks)
Files skipped from review due to trivial changes (1)
- examples/.env.sample
Additional context used
LanguageTool
CHANGELOG.md
[grammar] ~9-~9: You’ve repeated a verb. Did you mean to only write one of them? (REPEATED_VERBS)
Context: ...uth token. ## [1.0.0] - 2024-05-23 ### Added - Addtry_deploy
function to theDeployer
...
[style] ~13-~13: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...- a standard for non-fungible tokens. - Addcep18
andcep78
templates. ### Cha...
[grammar] ~46-~46: Did you mean “disabling”? Or maybe you should add a pronoun? In active voice, ‘allow’ + ‘to’ takes an object, usually a pronoun. (ALLOW_TO)
Context: ...orfeature for
odra` crate. It allows to disable the allocator used by Odra Framework in...
[style] ~74-~74: ‘taken into account’ might be wordy. Consider a shorter alternative. (EN_WORDINESS_PREMIUM_TAKEN_INTO_ACCOUNT)
Context: ...s been renamed toVar
. - Spent Gas is taken into account when checking an account balance. This ...
[duplication] ~85-~85: Possible typo: you repeated a word (ENGLISH_WORD_REPEAT_RULE)
Context: ...is the only code generation point. ### Removed - Removed#[odra::init]
macro - now only one me...
[style] ~98-~98: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...-casper-shared,
odra-utilscrates. - Removed
OdraEventtrait,
odrareexports
ca...
[uncategorized] ~101-~101: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...in test env with
ContractCallResult` struct which holds all information about the l...
[style] ~106-~106: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...tionalities. -odra-casper-rcp-client
crate providingCasperClient
for interactin...
[style] ~107-~107: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...sper node. -odra-casper-livenet-env
crate providing a host environment fo for the...
[uncategorized] ~124-~124: Possible missing preposition found. (AI_HYDRA_LEO_MISSING_OF)
Context: ...WASM. -odra-types
are the only types crate. ### Removed - Removed `odra-casper-ty...
[duplication] ~126-~126: Possible typo: you repeated a word (ENGLISH_WORD_REPEAT_RULE)
Context: ...a-typesare the only types crate. ### Removed - Removed
odra-casper-typesand
odra-mock-vm-t...
[uncategorized] ~159-~159: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...oxy_caller.wasm. -
odra-casper-shared,
odra-casper-typesand
odra-types` ar...
[uncategorized] ~190-~190: Possible missing article found. (AI_HYDRA_LEO_MISSING_A)
Context: ...t_exception!macro. It no longer needs new instance of Ref. ### Changed -
transf...
[uncategorized] ~198-~198: Possible missing article found. (AI_HYDRA_LEO_MISSING_A)
Context: ...- new module -Sequence
- for storing single value in the storage that can be increm...
[uncategorized] ~201-~201: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...les and Mappings now can be a part of a Mapping allowing to nest them. - Namespaces can...
[style] ~235-~235: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...s, moved fromodra-casper-backend
. - New crateodra-casper-types
- encapsulate...
[typographical] ~258-~258: Consider adding a comma here. (NN_NOT_NN_COMMA)
Context: ... -contract_env
andtest_env
are modules not structs. - To deploy contract i...
[uncategorized] ~279-~279: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...en()functions. -
odra-casper-backend,
odra-casper-shared,
odra-casper-test...
[style] ~311-~311: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ... addition, and subtraction. -event
module that defines an event interface and com...
[style] ~312-~312: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...rface and companion errors. -error
module encapsulates errors that may occur duri...
[uncategorized] ~326-~326: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...ntations used to run tests. -MockVM
, a lightweight blockchain virtual machin...
[style] ~331-~331: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ... Procedural macroodra::instance
. - Procedural macroodra::external_contract
. - Pr...
[style] ~332-~332: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...al macroodra::external_contract
. - Procedural macroodra::execution_error
. - Proc...
[style] ~333-~333: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...ural macroodra::execution_error
. - Procedural macroodra::odra_error
. - Derive ma...
Markdownlint
CHANGELOG.md
284-284: Expected: 4; Actual: 2 (MD005, list-indent)
Inconsistent indentation for list items at the same level
239-239: Expected: 2; Actual: 3 (MD007, ul-indent)
Unordered list indentation
240-240: Expected: 2; Actual: 3 (MD007, ul-indent)
Unordered list indentation
241-241: Expected: 2; Actual: 3 (MD007, ul-indent)
Unordered list indentation
242-242: Expected: 2; Actual: 3 (MD007, ul-indent)
Unordered list indentation
243-243: Expected: 2; Actual: 3 (MD007, ul-indent)
Unordered list indentation
252-252: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
253-253: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
254-254: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
255-255: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
256-256: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
257-257: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
258-258: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
259-259: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
260-260: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
281-281: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
282-282: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
283-283: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
78-78: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
102-102: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
106-106: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
167-167: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
234-234: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
4-4: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
4-4: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
5-5: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
5-5: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
8-8: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
9-9: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
9-9: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
15-15: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
20-20: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
21-21: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
21-21: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
24-24: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
25-25: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
25-25: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
35-35: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
40-40: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
43-43: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
44-44: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
44-44: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
50-50: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
55-55: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
85-85: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
100-100: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
115-115: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
121-121: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
122-122: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
122-122: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
126-126: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
130-130: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
131-131: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
131-131: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
135-135: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
138-138: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
139-139: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
139-139: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
146-146: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
151-151: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
156-156: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
157-157: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
157-157: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
163-163: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
166-166: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
172-172: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
176-176: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
177-177: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
177-177: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
186-186: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
192-192: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
196-196: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
197-197: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
197-197: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
216-216: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
220-220: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
223-223: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
224-224: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
224-224: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
250-250: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
289-289: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
294-294: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
295-295: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
295-295: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
298-298: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
299-299: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
299-299: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
60-60: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
62-62: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
64-64: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
66-66: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
6-6: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
10-10: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
16-16: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
22-22: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
26-26: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
36-36: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
41-41: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
45-45: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
51-51: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
56-56: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
59-59: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
67-67: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
86-86: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
101-101: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
116-116: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
123-123: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
127-127: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
132-132: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
136-136: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
140-140: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
147-147: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
152-152: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
158-158: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
164-164: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
167-167: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
173-173: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
178-178: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
187-187: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
193-193: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
198-198: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
217-217: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
221-221: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
225-225: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
251-251: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
290-290: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
296-296: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
300-300: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
41-41: null (MD034, no-bare-urls)
Bare URL used
Additional comments not posted (4)
CHANGELOG.md (1)
4-7
: The changelog entry for version 1.1.0 is clear and accurately reflects the addition of CSPR.cloud's auth token support.Tools
Markdownlint
4-4: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
4-4: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
5-5: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
5-5: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
6-6: null (MD032, blanks-around-lists)
Lists should be surrounded by blank linesodra-casper/rpc-client/src/casper_client.rs (3)
93-93
: Validate the optional environment variable retrieval forcspr_cloud_auth_token
.The use of
get_optional_env_variable
forcspr_cloud_auth_token
is appropriate as it allows the token to be optional, aligning with typical authentication token handling practices.
747-750
: Review the handling of the CSPR.cloud auth token in HTTP headers.The conditional addition of the "Authorization" header based on the presence of
cspr_cloud_auth_token
is correctly implemented. This ensures that the token is only sent when available, maintaining security and functionality.
68-68
: Ensure proper handling ofcspr_cloud_auth_token
initialization.
/// Environment variable holding cspr.cloud auth token. | ||
pub const ENV_CSPR_CLOUD_AUTH_TOKEN: &str = "CSPR_CLOUD_AUTH_TOKEN"; |
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.
Add documentation for ENV_CSPR_CLOUD_AUTH_TOKEN
.
It's good practice to document the purpose and usage of each environment variable, especially for new additions like ENV_CSPR_CLOUD_AUTH_TOKEN
. This helps maintain clarity and usability of the code.
Summary by CodeRabbit
New Features
try_deploy
function to handle contract deployments and failures.Cep18
standard for fungible tokens.Documentation
.env.sample
to include settings for CSPR.cloud's RPC address and authentication token.Chores