mirror of
https://github.com/zammad/zammad
synced 2026-05-24 09:48:36 +00:00
- 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.
29 lines
539 B
Ruby
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
|