postIt #2
8 changed files with 141 additions and 3 deletions
GET posts [dev] 200
commit
b7873ebd7c
16
contrib/bruno/Get Posts.bru
Normal file
16
contrib/bruno/Get Posts.bru
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
info:
|
||||
name: Get Posts
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: https://jsonplaceholder.typicode.com/users
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: This request retrieves a list of users from the JSONPlaceholder API.
|
||||
15
contrib/bruno/Untitled.bru
Normal file
15
contrib/bruno/Untitled.bru
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
info:
|
||||
name: Untitled
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: ""
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
15
contrib/bruno/blogs.yml
Normal file
15
contrib/bruno/blogs.yml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
info:
|
||||
name: blogs
|
||||
type: http
|
||||
seq: 1
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{Blogs}}/api/v1/blog"
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
6
contrib/bruno/environments/Development.yml
Normal file
6
contrib/bruno/environments/Development.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
name: Development
|
||||
variables:
|
||||
- name: Blogs
|
||||
value: https://localhost:5003
|
||||
- name: Authority
|
||||
value: https://localhost:5001
|
||||
6
contrib/bruno/environments/Production.yml
Normal file
6
contrib/bruno/environments/Production.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
name: Production
|
||||
variables:
|
||||
- name: Authority
|
||||
value: https://yavsc.pschneider.fr
|
||||
- name: Blogs
|
||||
value: https://blogs.pschneider.fr
|
||||
42
contrib/bruno/opencollection.yml
Normal file
42
contrib/bruno/opencollection.yml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
opencollection: 1.0.0
|
||||
|
||||
info:
|
||||
name: blogs
|
||||
config:
|
||||
proxy:
|
||||
inherit: true
|
||||
config:
|
||||
protocol: http
|
||||
hostname: ""
|
||||
port: ""
|
||||
auth:
|
||||
username: ""
|
||||
password: ""
|
||||
bypassProxy: ""
|
||||
|
||||
request:
|
||||
auth:
|
||||
type: oauth2
|
||||
flow: authorization_code
|
||||
authorizationUrl: "{{Authority}}/connect/authorize"
|
||||
accessTokenUrl: "{{Authority}}/connect/token"
|
||||
callbackUrl: https://localhost:5001
|
||||
credentials:
|
||||
clientId: postit
|
||||
placement: body
|
||||
scope: openid blogs
|
||||
pkce: {}
|
||||
tokenConfig:
|
||||
id: credentials
|
||||
placement:
|
||||
header: Bearer
|
||||
source: access_token
|
||||
settings:
|
||||
autoFetchToken: true
|
||||
autoRefreshToken: false
|
||||
bundled: false
|
||||
extensions:
|
||||
bruno:
|
||||
ignore:
|
||||
- node_modules
|
||||
- .git
|
||||
|
|
@ -8,12 +8,26 @@
|
|||
"https://localhost:5005"
|
||||
]
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"YavscConnection": "Server=localhost;Port=5432;Database=lame-db-name;Username=lame-user-name;Password=lame-password;"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"Microsoft.AspNetCore.Authentication": "Debug"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
"Endpoints": {
|
||||
"Http": {
|
||||
"Url": "http://localhost:5002"
|
||||
},
|
||||
"Https": {
|
||||
"Url": "https://localhost:5003"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,6 +91,30 @@ public static class ServiceExtensions
|
|||
RoleClaimType = YavscConstants.RoleClaimType
|
||||
};
|
||||
options.MapInboundClaims = true;
|
||||
|
||||
// Dev: every Yavsc resource service (Yavsc.Api, Yavsc.Blogs,
|
||||
// Yavsc.Org itself) validates JWTs against the OP that runs
|
||||
// on https://localhost:5001 with a self-signed dev cert.
|
||||
// The default .NET HttpClient rejects self-signed certs, so
|
||||
// JwtBearer's backchannel silently fails to fetch the OIDC
|
||||
// discovery + JWKS. With an empty ValidIssuer, every token
|
||||
// is rejected with IDX10204 ("ValidIssuer is null or
|
||||
// whitespace"). Telling the backchannel to skip TLS
|
||||
// validation unblocks discovery in dev. Production uses a
|
||||
// real CA-signed cert and the default validation path; the
|
||||
// override is gated on HostingEnvironment == Development
|
||||
// and only fires when the consumer opt-in via the
|
||||
// 'Yavsc:Dev:TlsInsecure' configuration flag (default
|
||||
// false), so a misconfigured production environment cannot
|
||||
// silently downgrade TLS.
|
||||
if (configuration.GetValue<string>("ASPNETCORE_ENVIRONMENT") == "Development")
|
||||
{
|
||||
options.BackchannelHttpHandler = new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback =
|
||||
(_, _, _, _) => true
|
||||
};
|
||||
}
|
||||
configure?.Invoke(options);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue