You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2017/04/20 16:05:54 UTC
[1/5] incubator-trafficcontrol git commit: Org tenancy: user/current,
in case of ldap, hardcode tenantId and tenant to be undef
Repository: incubator-trafficcontrol
Updated Branches:
refs/heads/master 0e8978bda -> dbd68c66b
Org tenancy: user/current, in case of ldap, hardcode tenantId and tenant to be undef
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/d7921fee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/d7921fee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/d7921fee
Branch: refs/heads/master
Commit: d7921feefcd5e339a967a9d9b47fbbc115850c8f
Parents: cc679cc
Author: Ori Finkelman <or...@qwilt.com>
Authored: Wed Apr 19 23:41:54 2017 +0300
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Thu Apr 20 10:05:19 2017 -0600
----------------------------------------------------------------------
traffic_ops/app/lib/API/User.pm | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/d7921fee/traffic_ops/app/lib/API/User.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/User.pm b/traffic_ops/app/lib/API/User.pm
index 72c1a4c..1d771e7 100644
--- a/traffic_ops/app/lib/API/User.pm
+++ b/traffic_ops/app/lib/API/User.pm
@@ -284,14 +284,13 @@ sub current {
if ( &is_ldap($self) ) {
my $role = $self->db->resultset('Role')->search( { name => "read-only" } )->get_column('id')->single;
- my $user_tenant_id = $self->current_user_tenant();
- my $user_tenant = defined($user_tenant_id) ? $self->db->resultset('Tenant')->search( { id => $user_tenant_id } )->get_column('name')->single : undef;
+
push(
@data, {
"id" => "0",
"username" => $current_username,
- "tenantId" => $user_tenant_id,
- "tenant" => $user_tenant,
+ "tenantId" => undef,
+ "tenant" => undef,
"publicSshKey" => "",
"role" => $role,
"uid" => "0",
[5/5] incubator-trafficcontrol git commit: This closes #434
Posted by mi...@apache.org.
This closes #434
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/dbd68c66
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/dbd68c66
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/dbd68c66
Branch: refs/heads/master
Commit: dbd68c66b45b37d033a150a48bf1d1bee57b8f7b
Parents: d7921fe
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Thu Apr 20 10:05:43 2017 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Thu Apr 20 10:05:43 2017 -0600
----------------------------------------------------------------------
----------------------------------------------------------------------
[3/5] incubator-trafficcontrol git commit: org tenancy. add tenant
name to user api
Posted by mi...@apache.org.
org tenancy. add tenant name to user api
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/dbc0bd8f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/dbc0bd8f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/dbc0bd8f
Branch: refs/heads/master
Commit: dbc0bd8fa64d11feaef11fa3d2aa18e1e874e452
Parents: 0e8978b
Author: Ori Finkelman <or...@qwilt.com>
Authored: Thu Apr 6 11:38:34 2017 +0300
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Thu Apr 20 10:05:19 2017 -0600
----------------------------------------------------------------------
docs/source/development/traffic_ops_api/v12/user.rst | 14 +++++++++++++-
traffic_ops/app/lib/API/User.pm | 13 ++++++++++---
traffic_ops/app/t/api/1.2/user.t | 14 +++++++++-----
3 files changed, 32 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/dbc0bd8f/docs/source/development/traffic_ops_api/v12/user.rst
----------------------------------------------------------------------
diff --git a/docs/source/development/traffic_ops_api/v12/user.rst b/docs/source/development/traffic_ops_api/v12/user.rst
index 36e08a7..c84dfc5 100644
--- a/docs/source/development/traffic_ops_api/v12/user.rst
+++ b/docs/source/development/traffic_ops_api/v12/user.rst
@@ -72,6 +72,8 @@ Users
+----------------------+--------+------------------------------------------------+
|``stateOrProvince`` | string | |
+----------------------+--------+------------------------------------------------+
+ | ``tenant`` | string | Owning tenant name |
+ +----------------------+--------+------------------------------------------------+
| ``tenantId`` | int | Owning tenant ID |
+----------------------+--------+------------------------------------------------+
|``uid`` | string | |
@@ -102,6 +104,7 @@ Users
"role": "6",
"rolename": "admin",
"stateOrProvince": "",
+ "tenant": "root",
"tenantId": 1,
"uid": "0",
"username": "tsimpson"
@@ -172,6 +175,8 @@ Users
+----------------------+--------+------------------------------------------------+
|``stateOrProvince`` | string | |
+----------------------+--------+------------------------------------------------+
+ | ``tenant`` | string | Owning tenant name |
+ +----------------------+--------+------------------------------------------------+
| ``tenantId`` | int | Owning tenant ID |
+----------------------+--------+------------------------------------------------+
|``uid`` | string | |
@@ -202,6 +207,7 @@ Users
"role": "6",
"rolename": "admin",
"stateOrProvince": "",
+ "tenant": "root",
"tenantId": 1,
"uid": "0",
"username": "tsimpson"
@@ -454,7 +460,7 @@ Users
Role(s) Required: None
- **Request Properties**
+ **Response Properties**
+----------------------+---------+------------------------------------------------+
| Parameter | Type | Description |
@@ -493,6 +499,8 @@ Users
+----------------------+---------+------------------------------------------------+
|``postalCode`` | string | |
+----------------------+---------+------------------------------------------------+
+ | ``tenant`` | string | Owning tenant name |
+ +----------------------+---------+------------------------------------------------+
| ``tenantId`` | int | Owning tenant ID |
+----------------------+---------+------------------------------------------------+
@@ -517,6 +525,7 @@ Users
"addressLine1": "",
"gid": "0",
"postalCode": "",
+ "tenant": "root",
"tenantId": 1
},
@@ -571,6 +580,8 @@ Users
+----------------------+---------+------------------------------------------------+
|``postalCode`` | string | |
+----------------------+---------+------------------------------------------------+
+ | ``tenant`` | string | Owning tenant name |
+ +----------------------+---------+------------------------------------------------+
| ``tenantId`` | int | Owning tenant ID |
+----------------------+---------+------------------------------------------------+
@@ -595,6 +606,7 @@ Users
"addressLine1": "",
"gid": "0",
"postalCode": "",
+ "tenant": "root",
"tenantId": 1,
}
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/dbc0bd8f/traffic_ops/app/lib/API/User.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/User.pm b/traffic_ops/app/lib/API/User.pm
index 34af5e6..88b4d9a 100644
--- a/traffic_ops/app/lib/API/User.pm
+++ b/traffic_ops/app/lib/API/User.pm
@@ -69,7 +69,7 @@ sub index {
my $dbh;
if ( defined $username ) {
- $dbh = $self->db->resultset("TmUser")->search( { username => $username }, { prefetch => [ { 'role' => undef } ], order_by => 'me.' . $orderby } );
+ $dbh = $self->db->resultset("TmUser")->search( { username => $username }, { prefetch => [ { 'role' => undef }, 'tenant' ], order_by => 'me.' . $orderby } );
}
else {
$dbh = $self->db->resultset("TmUser")->search( undef, { prefetch => [ { 'role' => undef } ], order_by => 'me.' . $orderby } );
@@ -98,6 +98,7 @@ sub index {
"stateOrProvince" => $row->state_or_province,
"uid" => $row->uid,
"username" => $row->username,
+ "tenant" => defined ($row->tenant) ? $row->tenant->name : "N/A",
"tenantId" => $row->tenant_id
}
);
@@ -109,7 +110,7 @@ sub show {
my $self = shift;
my $id = $self->param('id');
- my $rs_data = $self->db->resultset("TmUser")->search( { 'me.id' => $id }, { prefetch => [ 'role' ] } );
+ my $rs_data = $self->db->resultset("TmUser")->search( { 'me.id' => $id }, { prefetch => [ 'role' , 'tenant'] } );
my @data = ();
while ( my $row = $rs_data->next ) {
push(
@@ -134,6 +135,7 @@ sub show {
"stateOrProvince" => $row->state_or_province,
"uid" => $row->uid,
"username" => $row->username,
+ "tenant" => defined ($row->tenant) ? $row->tenant->name : "N/A",
"tenantId" => $row->tenant_id
}
);
@@ -216,6 +218,7 @@ sub update {
$response->{username} = $rs->username;
$response->{tenantId} = $rs->tenant_id;
+
&log( $self, "Updated User with username '" . $rs->username . "' for id: " . $rs->id, "APICHANGE" );
return $self->success( $response, "User update was successful." );
@@ -281,11 +284,14 @@ sub current {
if ( &is_ldap($self) ) {
my $role = $self->db->resultset('Role')->search( { name => "read-only" } )->get_column('id')->single;
+ my $user_tenant_id = $self->current_user_tenant();
+ my $user_tenant = defined($user_tenant_id) ? $self->db->resultset('Tenant')->search( { id => $user_tenant_id } )->get_column('name')->single : "N/A";
push(
@data, {
"id" => "0",
"username" => $current_username,
- "tenantId" => $self->current_user_tenant(),
+ "tenantId" => $user_tenant_id,
+ "tenant" => $user_tenant,
"publicSshKey" => "",
"role" => $role,
"uid" => "0",
@@ -330,6 +336,7 @@ sub current {
"phoneNumber" => $row->phone_number,
"postalCode" => $row->postal_code,
"country" => $row->country,
+ "tenant" => defined ($row->tenant) ? $row->tenant->name : "N/A",
"tenantId" => $row->tenant_id,
}
);
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/dbc0bd8f/traffic_ops/app/t/api/1.2/user.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/api/1.2/user.t b/traffic_ops/app/t/api/1.2/user.t
index d913043..87250c5 100644
--- a/traffic_ops/app/t/api/1.2/user.t
+++ b/traffic_ops/app/t/api/1.2/user.t
@@ -46,7 +46,7 @@ sub run_ut {
Test::TestHelper->load_core_data($schema);
my $tenant_id = $schema->resultset('TmUser')->find( { username => $login_user } )->get_column('tenant_id');
- my $tenant_name = defined ($tenant_id) ? $schema->resultset('Tenant')->find( { id => $tenant_id } )->get_column('name') : "null";
+ my $tenant_name = defined ($tenant_id) ? $schema->resultset('Tenant')->find( { id => $tenant_id } )->get_column('name') : "N/A";
ok my $portal_user = $schema->resultset('TmUser')->find( { username => $login_user } ), 'Tenant $tenant_name: Does the portal user exist?';
@@ -54,7 +54,8 @@ sub run_ut {
$t->post_ok( '/api/1.2/user/login', json => { u => $login_user, p => $login_password} )->status_is(200);
$t->get_ok('/api/1.2/user/current.json')->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } )
->json_is( "/response/username", $login_user )
- ->json_is( "/response/tenantId", $tenant_id);
+ ->json_is( "/response/tenantId", $tenant_id)
+ ->json_is( "/response/tenant", $tenant_name);
# Test required fields
$t->post_ok( '/api/1.2/user/current/update',
@@ -65,7 +66,8 @@ sub run_ut {
#verify tenancy
$t->get_ok('/api/1.2/user/current.json')->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } )
->json_is( "/response/username", $login_user )
- ->json_is( "/response/tenantId", $tenant_id);
+ ->json_is( "/response/tenantId", $tenant_id)
+ ->json_is( "/response/tenant", $tenant_name);
# Test required fields
if (defined($tenant_id)){
@@ -77,7 +79,8 @@ sub run_ut {
#verify tenancy
$t->get_ok('/api/1.2/user/current.json')->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } )
->json_is( "/response/username", $login_user )
- ->json_is( "/response/tenantId", $tenant_id);
+ ->json_is( "/response/tenantId", $tenant_id)
+ ->json_is( "/response/tenant", $tenant_name);
#cannot removed the tenant on current user
$t->post_ok( '/api/1.2/user/current/update',
@@ -87,7 +90,8 @@ sub run_ut {
#verify tenancy
$t->get_ok('/api/1.2/user/current.json')->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } )
->json_is( "/response/username", $login_user )
- ->json_is( "/response/tenantId", $tenant_id);
+ ->json_is( "/response/tenantId", $tenant_id)
+ ->json_is( "/response/tenant", $tenant_name);
}
[4/5] incubator-trafficcontrol git commit: Org tenancy: use undef
when tenant does not exist instead of "N/A"
Posted by mi...@apache.org.
Org tenancy: use undef when tenant does not exist instead of "N/A"
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/e39428f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/e39428f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/e39428f1
Branch: refs/heads/master
Commit: e39428f1dc816babf06cda9cd6316be00f2e7cd1
Parents: dbc0bd8
Author: Ori Finkelman <or...@qwilt.com>
Authored: Tue Apr 18 15:13:11 2017 +0300
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Thu Apr 20 10:05:19 2017 -0600
----------------------------------------------------------------------
traffic_ops/app/lib/API/User.pm | 14 +++++++-------
traffic_ops/app/t/api/1.2/user.t | 9 +++++----
2 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e39428f1/traffic_ops/app/lib/API/User.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/User.pm b/traffic_ops/app/lib/API/User.pm
index 88b4d9a..3831392 100644
--- a/traffic_ops/app/lib/API/User.pm
+++ b/traffic_ops/app/lib/API/User.pm
@@ -69,10 +69,10 @@ sub index {
my $dbh;
if ( defined $username ) {
- $dbh = $self->db->resultset("TmUser")->search( { username => $username }, { prefetch => [ { 'role' => undef }, 'tenant' ], order_by => 'me.' . $orderby } );
+ $dbh = $self->db->resultset("TmUser")->search( { username => $username }, { prefetch => [ 'role', 'tenant' ], order_by => 'me.' . $orderby } );
}
else {
- $dbh = $self->db->resultset("TmUser")->search( undef, { prefetch => [ { 'role' => undef } ], order_by => 'me.' . $orderby } );
+ $dbh = $self->db->resultset("TmUser")->search( undef, { prefetch => [ 'role', 'tenant' ], order_by => 'me.' . $orderby } );
}
while ( my $row = $dbh->next ) {
@@ -98,7 +98,7 @@ sub index {
"stateOrProvince" => $row->state_or_province,
"uid" => $row->uid,
"username" => $row->username,
- "tenant" => defined ($row->tenant) ? $row->tenant->name : "N/A",
+ "tenant" => defined ($row->tenant) ? $row->tenant->name : undef,
"tenantId" => $row->tenant_id
}
);
@@ -135,7 +135,7 @@ sub show {
"stateOrProvince" => $row->state_or_province,
"uid" => $row->uid,
"username" => $row->username,
- "tenant" => defined ($row->tenant) ? $row->tenant->name : "N/A",
+ "tenant" => defined ($row->tenant) ? $row->tenant->name : undef,
"tenantId" => $row->tenant_id
}
);
@@ -285,7 +285,7 @@ sub current {
if ( &is_ldap($self) ) {
my $role = $self->db->resultset('Role')->search( { name => "read-only" } )->get_column('id')->single;
my $user_tenant_id = $self->current_user_tenant();
- my $user_tenant = defined($user_tenant_id) ? $self->db->resultset('Tenant')->search( { id => $user_tenant_id } )->get_column('name')->single : "N/A";
+ my $user_tenant = defined($user_tenant_id) ? $self->db->resultset('Tenant')->search( { id => $user_tenant_id } )->get_column('name')->single : undef;
push(
@data, {
"id" => "0",
@@ -314,7 +314,7 @@ sub current {
return $self->success( @data );
}
else {
- my $dbh = $self->db->resultset('TmUser')->search( { username => $current_username } );
+ my $dbh = $self->db->resultset('TmUser')->search( { username => $current_username } , { prefetch => [ 'role' , 'tenant'] } );
while ( my $row = $dbh->next ) {
push(
@data, {
@@ -336,7 +336,7 @@ sub current {
"phoneNumber" => $row->phone_number,
"postalCode" => $row->postal_code,
"country" => $row->country,
- "tenant" => defined ($row->tenant) ? $row->tenant->name : "N/A",
+ "tenant" => defined ($row->tenant) ? $row->tenant->name : undef,
"tenantId" => $row->tenant_id,
}
);
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/e39428f1/traffic_ops/app/t/api/1.2/user.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/api/1.2/user.t b/traffic_ops/app/t/api/1.2/user.t
index 87250c5..d1488a9 100644
--- a/traffic_ops/app/t/api/1.2/user.t
+++ b/traffic_ops/app/t/api/1.2/user.t
@@ -46,7 +46,8 @@ sub run_ut {
Test::TestHelper->load_core_data($schema);
my $tenant_id = $schema->resultset('TmUser')->find( { username => $login_user } )->get_column('tenant_id');
- my $tenant_name = defined ($tenant_id) ? $schema->resultset('Tenant')->find( { id => $tenant_id } )->get_column('name') : "N/A";
+ my $tenant_name = defined ($tenant_id) ? $schema->resultset('Tenant')->find( { id => $tenant_id } )->get_column('name') : undef;
+ my $tenant = defined ($tenant_name) ? $tenant_name : "null";
ok my $portal_user = $schema->resultset('TmUser')->find( { username => $login_user } ), 'Tenant $tenant_name: Does the portal user exist?';
@@ -98,15 +99,15 @@ sub run_ut {
# Ensure unique emails
ok $t->post_ok( '/api/1.2/user/current/update', json => { user => { username => $login_user, email => 'testportal1@kabletown.com', tenantId => $tenant_id } } )
->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } )->json_is( "/alerts/0/level", "success" ),
- "Tenant $tenant_name: Verify that the emails are unique";
+ "Tenant $tenant: Verify that the emails are unique";
ok $t->post_ok( '/api/1.2/user/current/update', json => { user => { username => $login_user, email => '@kabletown.com', tenantId => $tenant_id } } )
->status_is(400)->or( sub { diag $t->tx->res->content->asset->{content}; } )->json_is( "/alerts/0/level", "error" ),
- "Tenant $tenant_name: Verify that the emails are properly formatted";
+ "Tenant $tenant: Verify that the emails are properly formatted";
ok $t->post_ok( '/api/1.2/user/current/update', json => { user => { username => $login_user, email => '@kabletown.com', tenantId => $tenant_id } } )
->status_is(400)->or( sub { diag $t->tx->res->content->asset->{content}; } )->json_is( "/alerts/0/level", "error" ),
- "Tenant $tenant_name: Verify that the usernames are unique";
+ "Tenant $tenant: Verify that the usernames are unique";
$t->post_ok( '/api/1.2/user/current/update', json => { user => { email => 'testportal1@kabletown.com', tenantId => $tenant_id } } )->status_is(400)
->or( sub { diag $t->tx->res->content->asset->{content}; } )->json_is( "/alerts/0/text", "username is required" );
[2/5] incubator-trafficcontrol git commit: Org tenancy,
tenant name in API, recommit minor fix
Posted by mi...@apache.org.
Org tenancy, tenant name in API, recommit minor fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/cc679cc9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/cc679cc9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/cc679cc9
Branch: refs/heads/master
Commit: cc679cc9d10877b9c903802eb4eff01f75c28212
Parents: e39428f
Author: Ori Finkelman <or...@qwilt.com>
Authored: Tue Apr 18 22:46:41 2017 +0300
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Thu Apr 20 10:05:19 2017 -0600
----------------------------------------------------------------------
traffic_ops/app/lib/API/User.pm | 2 +-
traffic_ops/app/t/api/1.2/user.t | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cc679cc9/traffic_ops/app/lib/API/User.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/User.pm b/traffic_ops/app/lib/API/User.pm
index 3831392..72c1a4c 100644
--- a/traffic_ops/app/lib/API/User.pm
+++ b/traffic_ops/app/lib/API/User.pm
@@ -314,7 +314,7 @@ sub current {
return $self->success( @data );
}
else {
- my $dbh = $self->db->resultset('TmUser')->search( { username => $current_username } , { prefetch => [ 'role' , 'tenant'] } );
+ my $dbh = $self->db->resultset('TmUser')->search( { username => $current_username } , { prefetch => [ 'role' , 'tenant' ] } );
while ( my $row = $dbh->next ) {
push(
@data, {
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cc679cc9/traffic_ops/app/t/api/1.2/user.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/api/1.2/user.t b/traffic_ops/app/t/api/1.2/user.t
index d1488a9..8d13c4a 100644
--- a/traffic_ops/app/t/api/1.2/user.t
+++ b/traffic_ops/app/t/api/1.2/user.t
@@ -51,6 +51,7 @@ sub run_ut {
ok my $portal_user = $schema->resultset('TmUser')->find( { username => $login_user } ), 'Tenant $tenant_name: Does the portal user exist?';
+
# Verify the Portal user
$t->post_ok( '/api/1.2/user/login', json => { u => $login_user, p => $login_password} )->status_is(200);
$t->get_ok('/api/1.2/user/current.json')->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } )