Skip to content
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

guide: basic auth with JS #40

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

guide: basic auth with JS #40

wants to merge 1 commit into from

Conversation

stb13579
Copy link
Contributor

@stb13579 stb13579 commented Feb 4, 2025

Don't merge! This is only for testing a doc tool.

HttpProtocolBuilder httpProtocol = http
.baseUrl("https://api.example.com")
.acceptHeader("application/json")
.authorizationHeader(session -> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

).protocols(httpProtocol);
}
}
//#basic-auth-example
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git friendly empty line

.acceptHeader("application/json")
// Use built-in basicAuth with dynamic credentials from the feeder
.basicAuth(
(session) => session.get("username"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

val httpProtocol = http
.baseUrl("https://api.example.com")
.acceptHeader("application/json")
.basicAuth({ session -> session.getString("username") }) { session -> session.getString("password") }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

)
).protocols(httpProtocol)
}
//#basic-auth-example
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git friendly empty line

content/guides/basic-auth/index.md Show resolved Hide resolved
@@ -38,8 +38,7 @@ export default simulation((setUp) => {
.acceptHeader("application/json")
// Use built-in basicAuth with dynamic credentials from the feeder
.basicAuth(
(session) => session.get("username"),
(session) => session.get("password")
"#{username}", "#{password}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

single line like in Scala and Kotlin, otherwise it won't be consistent across programming languages.

Comment on lines +29 to +30
.basicAuth("#{username}", "#{password}"
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.basicAuth("#{username}", "#{password}"
);
.basicAuth("#{username}", "#{password}");

Comment on lines +40 to +41
.basicAuth( "#{username}", "#{password}"
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.basicAuth( "#{username}", "#{password}"
);
.basicAuth( "#{username}", "#{password}");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants