8000 Display bool values as metrics, Dont display request_matcher anymore · symfony/symfony@fd9a5d2 · GitHub
[go: up one dir, main page]

Skip to content

Commit fd9a5d2

Browse files
committed
Display bool values as metrics, Dont display request_matcher anymore
1 parent 9549901 commit fd9a5d2

File tree

2 files changed

+71
-22
lines changed

2 files changed

+71
-22
lines changed

src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php

Lines changed: 1 addition & 15 deletions
8000
Original file line numberDiff line numberDiff line change
@@ -132,24 +132,10 @@ public function collect(Request $request, Response $response, \Exception $except
132132

133133
// collect firewall context informations
134134
if ($this->firewallMap instanceof ContextAwareFirewallMapInterface) {
135-
$this->data['firewall'] = array('name' => null, 'config' => array());
136135
$firewallContext = $this->firewallMap->getContext($request);
137136

138137
if (null !== $firewallContext) {
139-
$config = $firewallContext->getConfig();
140-
$contextConfig = array();
141-
$contextConfig['request_matcher'] = $config->getRequestMatcher();
142-
$contextConfig['security'] = $config->hasSecurity();
143-
$contextConfig['context'] = $config->getContext();
144-
$contextConfig['entry_point'] = $config->getEntryPoint();
145-
$contextConfig['provider'] = $config->getProvider();
146-
$contextConfig['stateless'] = $config->isStateless();
147-
$contextConfig['access_denied_handler'] = $config->getAccessDeniedHandler();
148-
$contextConfig['access_denied_url'] = $config->getAccessDeniedUrl();
149-
$contextConfig['user_checker'] = $config->getUserChecker();
150-
151-
$this->data['firewall']['name'] = $config->getName();
152-
$this->data['firewall']['config'] = new ParameterBag($contextConfig);
138+
$this->data['firewall'] = $firewallContext->getConfig();
153139
}
154140
} else {
155141
$this->data['firewall'] = array();

src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
{% endif %}
3636
{% if collector.firewall|default([]) is not empty %}
3737
<div class="sf-toolbar-info-piece">
38-
<b>Firewall name</b>
39-
<span>{{ collector.firewall.name }}</span>
38+
<b>Firewall</b>
39+
<span>{{ collector.firewall.name|default('n/a') }}</span>
4040
</div>
4141
{% endif %}
4242
{% if collector.logoutUrl %}
@@ -126,17 +126,80 @@
126126
</div>
127127
{% endif %}
128128

129-
{% if collector.firewall|default([]) is not empty %}
130-
<h2>Security Firewall</h2>
129+
<h2>Security Firewall</h2>
131130

131+
{% if collector.firewall|default([]) is not empty %}
132132
<div class="metrics">
133133
<div class="metric">
134-
<span class="value">{{ collector.firewall.name|default('unknown') }}</span>
134+
<span class="value">{{ collector.firewall.name }}</span>
135135
<span class="label">Firewall Name</span>
136136
</div>
137+
<div class="metric">
138+
<span class="value">{{ include('@WebProfiler/Icon/' ~ (collector.firewall.security ? 'yes' : 'no') ~ '.svg') }}</span>
139+
<span class="label">Security</span>
140+
</div>
141+
<div class="metric">
142+
<span class="value">{{ include('@WebProfiler/Icon/' ~ (collector.firewall.stateless ? 'yes' : 'no') ~ '.svg') }}</span>
143+
<span class="label">Stateless</span>
144+
</div>
145+
<div class="metric">
146+
<span class="value">{{ include('@WebProfiler/Icon/' ~ (collector.firewall.listenerConfigs.anonymous is defined ? 'yes' : 'no') ~ '.svg') }}</span>
147+
<span class="label">Anonymous</span>
148+
</div>
149+
</div>
150+
{% if collector.firewall.security %}
151+
<table>
152+
<thead>
153+
<tr>
154+
<th scope="col" class="key">Key</th>
155+
<th scope="col">Value</th>
156+
</tr>
157+
</thead>
158+
<tbody>
159+
<tr>
160+
<th>provider</th>
161+
<td>{{ collector.firewall.provider }}</td>
162+
</tr>
163+
<tr>
164+
<th>context</th>
165+
<td>{{ collector.firewall.context }}</td>
166+
</tr>
167+
<tr>
168+
<th>entry_point</th>
169+
<td>{{ collector.firewall.entryPoint }}</td>
170+
</tr>
171+
<tr>
172+
<th>user_checker</th>
173+
<td>{{ collector.firewall.userChecker }}</td>
174+
</tr>
175+
<tr>
176+
<th>access_denied_handler</th>
177+
<td>{{ collector.firewall.accessDeniedHandler }}</td>
178+
</tr>
179+
<tr>
180+
<th>access_denied_url</th>
181+
<td>{{ collector.firewall.accessDeniedUrl }}</td>
182+
</tr>
183+
<tr>
184+
<th>listeners</th>
185+
<td>
186+
{% for name, listener in collector.firewall.listenerConfigs %}
187+
{{ name }}
188+
{{ profiler_dump(listener) }} <br>
189+
{% endfor %}
190+
</td>
191+
</tr>
192+
</tbody>
193+
</table>
194+
{% endif %}
195+
{% elseif collector.enabled %}
196+
<div class="empty">
197+
<p>There is no security firewall.</p>
198+
</div>
199+
{% else %}
200+
<div class="empty">
201+
<p>The security component is disabled.</p>
137202
</div>
138-
139-
{{ include('@WebProfiler/Profiler/bag.html.twig', { bag: collector.firewall.config, labels: ['Key', 'Value'] }, with_context = false) }}
140203
{% endif %}
141204

142205
{% if collector.voters|default([]) is not empty %}

0 commit comments

Comments
 (0)
0