zammad/lib/github/credentials.rb
Martin Gruner 64a87b1c67 Fixes #2709, fixes #2666, fixes #2665, fixes #556, fixes #3275 - Refactoring: Implement new translation toolchain based on gettext.
- Translations are no longer fetched from the cloud.
- Instead, they are extracted from the codebase and stored in i18n/zammad.pot.
- Translations will be managed via a public Weblate instance soon.
- The translated .po files are fed to the database as before.
- It is now possible to change "translation" strings for en-us locally via the admin GUI.
- It is no longer possible to submit local changes.
2021-11-15 16:58:19 +01:00

29 lines
539 B
Ruby

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
class GitHub
class Credentials
QUERY = <<-'GRAPHQL'.freeze
query {
viewer {
login
}
}
GRAPHQL
attr_reader :client
def initialize(client)
@client = client
end
def verify!
response = client.perform(
query: GitHub::Credentials::QUERY,
)
return if response.dig('data', 'viewer', 'login').present?
raise __('Invalid GitHub GraphQL API token')
end
end
end