mirror of
https://github.com/mastodon/mastodon.git
synced 2026-04-23 07:37:39 -05:00
Some checks are pending
Bundler Audit / security (push) Waiting to run
Check i18n / check-i18n (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (ruby) (push) Waiting to run
Check formatting / lint (push) Waiting to run
Haml Linting / lint (push) Waiting to run
Ruby Linting / lint (push) Waiting to run
Historical data migration test / test (14-alpine) (push) Waiting to run
Historical data migration test / test (15-alpine) (push) Waiting to run
Historical data migration test / test (16-alpine) (push) Waiting to run
Historical data migration test / test (17-alpine) (push) Waiting to run
Ruby Testing / build (production) (push) Waiting to run
Ruby Testing / build (test) (push) Waiting to run
Ruby Testing / test (.ruby-version) (push) Blocked by required conditions
Ruby Testing / test (3.2) (push) Blocked by required conditions
Ruby Testing / Libvips tests (.ruby-version) (push) Blocked by required conditions
Ruby Testing / Libvips tests (3.2) (push) Blocked by required conditions
Ruby Testing / End to End testing (.ruby-version) (push) Blocked by required conditions
Ruby Testing / End to End testing (3.2) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:8.10.2) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, opensearchproject/opensearch:2) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (3.2, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
36 lines
1.4 KiB
Ruby
36 lines
1.4 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe 'The /.well-known/oauth-authorization-server request' do
|
|
it 'returns http success with valid JSON response' do
|
|
get '/.well-known/oauth-authorization-server'
|
|
|
|
expect(response)
|
|
.to have_http_status(200)
|
|
.and have_attributes(
|
|
media_type: 'application/json'
|
|
)
|
|
|
|
grant_types_supported = Doorkeeper.configuration.grant_flows.dup
|
|
grant_types_supported << 'refresh_token' if Doorkeeper.configuration.refresh_token_enabled?
|
|
|
|
expect(response.parsed_body).to include(
|
|
issuer: root_url,
|
|
service_documentation: 'https://docs.joinmastodon.org/',
|
|
authorization_endpoint: oauth_authorization_url,
|
|
token_endpoint: oauth_token_url,
|
|
userinfo_endpoint: oauth_userinfo_url,
|
|
revocation_endpoint: oauth_revoke_url,
|
|
scopes_supported: Doorkeeper.configuration.scopes.map(&:to_s),
|
|
response_types_supported: Doorkeeper.configuration.authorization_response_types,
|
|
response_modes_supported: Doorkeeper.configuration.authorization_response_flows.flat_map(&:response_mode_matches).uniq,
|
|
token_endpoint_auth_methods_supported: %w(client_secret_basic client_secret_post),
|
|
grant_types_supported: grant_types_supported,
|
|
code_challenge_methods_supported: Doorkeeper.configuration.pkce_code_challenge_methods_supported,
|
|
# non-standard extension:
|
|
app_registration_endpoint: api_v1_apps_url
|
|
)
|
|
end
|
|
end
|