mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-27 20:29:39 +02:00
Precision pass on auth and resource analysis (#63)
This commit is contained in:
parent
064801a3a4
commit
c7c5e0f3a1
62 changed files with 4248 additions and 138 deletions
|
|
@ -53,11 +53,18 @@ pub fn extract_authorization_model(
|
|||
&actix_web::ActixWebExtractor,
|
||||
&rocket::RocketExtractor,
|
||||
];
|
||||
let mut model = AuthorizationModel::default();
|
||||
let mut model = AuthorizationModel {
|
||||
lang: lang.to_string(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
for extractor in extractors {
|
||||
if extractor.supports(lang, framework_ctx) {
|
||||
model.extend(extractor.extract(tree, bytes, path, rules));
|
||||
let mut other = extractor.extract(tree, bytes, path, rules);
|
||||
// Preserve the canonical `lang` set above; sub-extractors
|
||||
// build their own default-initialised models with empty lang.
|
||||
other.lang = model.lang.clone();
|
||||
model.extend(other);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue