should_skip_token_checks function

Determines whether token presence and validity checks should be skipped.

Determines whether token presence and validity checks should be skipped.

Skipping checks is useful in certain special cases, such as testing. Tests might rely on mocked API responses or fake API implementations, which don't require a valid token. It wouldn't make sense to demand a valid token in that context.

should_skip_token_checks()

Returns

boolean

Details

googleAuthR uses this function to know when the execution context is such that token checks should be skipped. This is ultimately determined by the value of the googleAuthR.skip_token_checks boolean option. Users or consumer libraries can set this option to signal that authentication is not needed.

In addition, this function detects the use of httptest::with_mock_API

and skips token checks in that case as well.

See Also

Other authentication functions: gar_attach_auto_auth(), gar_auth(), gar_auth_service(), gar_auto_auth(), gar_gce_auth(), get_google_token(), token_exists()

  • Maintainer: Erik Grönroos
  • License: MIT + file LICENSE
  • Last published: 2024-05-22