question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature request] wildcards in transaction names

See original GitHub issue

Hi,

First of all, thanks for Dredd, it’s an awesome tool and I enjoy using it more and more.

Here’s a suggestion. I’d like to be able to use wildcards in my hooks, so that every transaction within a group or a URI is handled by the same hook. For instance:

hooks.before("Admin > Member actions > *", function(transaction) {
  transaction.request['headers']['Authorization'] = 'Basic ADMINBASICAUTH'
});

or

hooks.before("Admin > *", function(transaction) {
  transaction.request['headers']['Authorization'] = 'Basic ADMINBASICAUTH'
});

Is that already possible in a way I missed (aside from copy/pasting for each transaction)? Is that a feature you plan to implement anytime soon?

Thanks!

Eric

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
honzajavorekcommented, Nov 4, 2016

It’s not in the JavaScript hooks yet. But you can easily code your own:

hooks.beforeEach(function(transaction, done) {
  if (transaction.name.match(/^Admin > Member actions > /)) {
    // do what you want
  }
  done();
}
2reactions
aledegcommented, Sep 8, 2016

As I mentioned in #622, it could be neat to also have this syntax supported in the --only command line option and in the config file as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Feature request] support wildcards in --only parameter · Issue #622 ...
Currently, if I have an apib file which describes multiple APIs, and I want to test a single one, I cannot do something...
Read more >
Add a wildcard to transaction name/search function (edited)
The problem is that sometimes the payee will have numbers or other information appended to it, which changes all the time, so it...
Read more >
Feature Request - Partial Merchant Name Rule : r/mintuit
I sent this in for a feature request on their “mintfam” website. Definitely would be a huge help. I suggested the ability to...
Read more >
Wildcard characters allow searching for patterns and variations
To perform a multiple-character wildcard search, use the asterisk ( * ) character. This wildcard finds words that contain zero or more ...
Read more >
Subdomain URL Placeholders - Auth0
Describes placeholders, including wildcard and organization placeholders, ... Allows Web Origins: List of URLs from where an authorization request using ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found