yii没有认证/授权的单个控制器的动作

I'm using yii-powered app as backend of public API. I created controllers/ApiController class with actionTest method and trying to get some data by url domain.ltd/api/test without authorization by login/pass which usually need for another controllers (SiteController, for example). How can I do this?

I think there are few variants:

  1. Setup route /api/* for guest access using authManager (?)
  2. Something magic with UserIdentity class...

To allow anyone to access that page, just specify that in rules of controller (similar to login page, as you can access it without logging in)

public function accessRules()
{
    return [
        [
            'allow',
            'actions' => ['test'],
            'users' => ['*'],
        ],
        ['deny', // deny all users
            'users' => ['*'],
        ],
    ];
}