This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Remove all dapp permissions related settings #9120
Merged
Merged
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f67b25e
Completely remove all dapps struct from rpc
sorpaas 0359e3d
Remove unused pub use
sorpaas ad20fb3
Remove dapp policy/permission func in ethcore
sorpaas 82ac926
Remove all dapps settings from rpc
sorpaas f21b14b
Fix rpc tests
sorpaas 1a4537c
Merge branch 'master' into sp-remove-dapp-permissions
sorpaas aedde18
Use both origin and user_agent
sorpaas 6a087d9
Address grumbles
sorpaas 74bd370
Merge branch 'master' of https://github.com/paritytech/parity into sp…
sorpaas 212ec7e
Address grumbles
sorpaas 1d93670
Fix tests
sorpaas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,9 +36,9 @@ pub struct RpcExtractor; | |
impl HttpMetaExtractor for RpcExtractor { | ||
type Metadata = Metadata; | ||
|
||
fn read_metadata(&self, _origin: Option<String>, user_agent: Option<String>, _dapps_origin: Option<String>) -> Metadata { | ||
fn read_metadata(&self, origin: Option<String>, user_agent: Option<String>) -> Metadata { | ||
Metadata { | ||
origin: match user_agent { | ||
origin: match user_agent.or(origin) { | ||
Some(service) => Origin::Rpc(service.into()), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it might be good to actually use the |
||
None => Origin::Rpc("unknown".into()), | ||
}, | ||
|
@@ -250,9 +250,9 @@ mod tests { | |
let extractor = RpcExtractor; | ||
|
||
// when | ||
let meta1 = extractor.read_metadata(None, None, None); | ||
let meta2 = extractor.read_metadata(None, Some("http://parity.io".to_owned()), None); | ||
let meta3 = extractor.read_metadata(None, Some("http://parity.io".to_owned()), Some("ignored".into())); | ||
let meta1 = extractor.read_metadata(None, None); | ||
let meta2 = extractor.read_metadata(None, Some("http://parity.io".to_owned())); | ||
let meta3 = extractor.read_metadata(None, Some("http://parity.io".to_owned())); | ||
|
||
// then | ||
assert_eq!(meta1.origin, Origin::Rpc("unknown".into())); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
IMHO should be other way around,
Origin
provides more info thanUserAgent
. Maybe best just do:?