Merge remote-tracking branch 'origin/release-v43' into release-v44

This commit is contained in:
Zaiming (Stone) Shi 2022-11-14 23:15:39 +01:00
commit 1783fa1e80
3 changed files with 15 additions and 7 deletions

View File

@ -11,12 +11,13 @@ on:
jobs: jobs:
prepare: prepare:
runs-on: ubuntu-20.04 runs-on: aws-amd64
container: ghcr.io/emqx/emqx-builder/4.4-20:24.3.4.2-1-ubuntu20.04 container: ghcr.io/emqx/emqx-builder/4.4-20:24.3.4.2-1-ubuntu20.04
outputs: outputs:
fast_ct_apps: ${{ steps.run_find_apps.outputs.fast_ct_apps }} fast_ct_apps: ${{ steps.run_find_apps.outputs.fast_ct_apps }}
docker_ct_apps: ${{ steps.run_find_apps.outputs.docker_ct_apps }} docker_ct_apps: ${{ steps.run_find_apps.outputs.docker_ct_apps }}
steps: steps:
- uses: AutoModality/action-clean@v1
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
path: source path: source
@ -40,6 +41,7 @@ jobs:
- name: get_all_deps - name: get_all_deps
working-directory: source working-directory: source
run: | run: |
git config --global --add safe.directory $(pwd)
# build the default profile for two purposes # build the default profile for two purposes
# 1. download all dependencies (so the individual app runs do not depend on github credentials) # 1. download all dependencies (so the individual app runs do not depend on github credentials)
# 2. some of the files such as segmented config files are not created when compiling only the test profile # 2. some of the files such as segmented config files are not created when compiling only the test profile
@ -55,7 +57,7 @@ jobs:
eunit_and_proper: eunit_and_proper:
needs: prepare needs: prepare
runs-on: ubuntu-20.04 runs-on: aws-amd64
container: ghcr.io/emqx/emqx-builder/4.4-20:24.3.4.2-1-ubuntu20.04 container: ghcr.io/emqx/emqx-builder/4.4-20:24.3.4.2-1-ubuntu20.04
strategy: strategy:
fail-fast: false fail-fast: false
@ -83,7 +85,7 @@ jobs:
fast_ct: fast_ct:
needs: prepare needs: prepare
runs-on: ubuntu-20.04 runs-on: ${{ matrix.runs-on }}
container: ghcr.io/emqx/emqx-builder/4.4-20:24.3.4.2-1-ubuntu20.04 container: ghcr.io/emqx/emqx-builder/4.4-20:24.3.4.2-1-ubuntu20.04
strategy: strategy:
fail-fast: false fail-fast: false
@ -246,7 +248,7 @@ jobs:
- eunit_and_proper - eunit_and_proper
- fast_ct - fast_ct
- docker_ct - docker_ct
runs-on: ubuntu-20.04 runs-on: aws-amd64
container: ghcr.io/emqx/emqx-builder/4.4-20:24.3.4.2-1-ubuntu20.04 container: ghcr.io/emqx/emqx-builder/4.4-20:24.3.4.2-1-ubuntu20.04
steps: steps:
- uses: AutoModality/action-clean@v1 - uses: AutoModality/action-clean@v1
@ -276,7 +278,7 @@ jobs:
finish: finish:
needs: make_cover needs: make_cover
runs-on: ubuntu-20.04 runs-on: aws-amd64
steps: steps:
- name: Coveralls Finished - name: Coveralls Finished
env: env:

View File

@ -125,7 +125,10 @@ handle_request(_Method, _Path, Req) ->
cowboy_req:reply(400, #{<<"content-type">> => <<"text/plain">>}, <<"Not found.">>, Req). cowboy_req:reply(400, #{<<"content-type">> => <<"text/plain">>}, <<"Not found.">>, Req).
authorize_appid(Req) -> authorize_appid(Req) ->
authorize_appid(cowboy_req:method(Req), cowboy_req:path(Req), Req). authorize_appid(
iolist_to_binary(string:uppercase(cowboy_req:method(Req))),
iolist_to_binary(cowboy_req:path(Req)),
Req).
authorize_appid(<<"GET">>, <<"/api/v4/emqx_prometheus">>, _Req) -> authorize_appid(<<"GET">>, <<"/api/v4/emqx_prometheus">>, _Req) ->
true; true;

View File

@ -107,7 +107,10 @@ http_handlers() ->
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
is_authorized(Req) -> is_authorized(Req) ->
is_authorized(cowboy_req:method(Req), cowboy_req:path(Req), Req). is_authorized(
iolist_to_binary(string:uppercase(cowboy_req:method(Req))),
iolist_to_binary(cowboy_req:path(Req)),
Req).
is_authorized(<<"GET">>, <<"/api/v4/emqx_prometheus">>, _Req) -> is_authorized(<<"GET">>, <<"/api/v4/emqx_prometheus">>, _Req) ->
true; true;