Create finder class for pipeline trigger tokens to use in graphql endpoint

Summary

After !125129 (merged) is merged, follow up on this conversation comment:

Should we introduce a finder class for Ci::Trigger and call it here? I think it's safer to always authorize the request in finders e.g. https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/finders/ci/pipelines_finder.rb#L26.

Refactor the Pipeline Triggers resolver to use a finder.

Improvements

It's safer to authorize a request in a finder

Involved components

  1. Create a trigger_finder
  2. Refactor app/graphql/resolvers/ci/pipeline_triggers_resolver.rb to use the finder
  3. Add specs
Edited by Missy Davies