Skip to content

feat: add webhook bearer auth support #619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions docs/site/content/zh/latest/tasks/mock/simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ items:
response:
header:
server: mock
content-type: application/json
body: |
{
"count": 1,
"items": [{
"title": "fix: there is a bug on page {{ randEnum "one" }}",
"number": 123,
"title": "fix: there is a bug on page {{ randEnum "one" "two" "three" "four" }}",
"number": {{randInt 100 199}},
"float": {{randFloat 0.0 1.0}},
"status": "{{randWeightEnum (weightObject 4 "open") (weightObject 1 "closed")}}",
"message": "{{.Response.Header.server}}",
"author": "someone",
"status": "success"
}]
"author": "{{env "USER"}}",
"created": "{{ now.Format "2006-01-02T15:04:05Z07:00" }}"
}],
"uptime": "{{uptime}}"
}
- name: base64
request:
Expand Down
26 changes: 25 additions & 1 deletion docs/site/content/zh/latest/tasks/template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,28 @@ title = "用例模板"

```
182{{shuffle "09876543"}}
```
```

## 带权重的随机枚举

下面的代码以 80% 的概率返回 `open`,以 20% 的概率返回 `closed`:

```
{{randWeightEnum (weightObject 4 "open") (weightObject 1 "closed")}}
```

## 时间

下面的代码可以生成当前时间,并制定时间格式:

```
{{ now.Format "2006-01-02T15:04:05Z07:00" }}
```

## 环境变量

下面的代码可以获取环境变量 `SHELL` 的值,在需要使用一个全局变量的时候,可以使用这个模板函数:

```
{{ env "SHELL" }}
```
Loading
Loading