GraphQL 미들웨어
GraphQL의 인증 가이드라인에 따라 인증은 한 곳, 즉 GraphQL 레이어와 리졸버 사이에 있어야 합니다. Casbin을 리졸버(또는 얇은 래퍼)에서 사용하여 타입, 필드 또는 작업에 대한 접근을 강제하세요.
// Casbin authorization logic lives inside postRepository
var postRepository = require('postRepository');
var postType = new GraphQLObjectType({
name: 'Post',
fields: {
body: {
type: GraphQLString,
resolve: (post, args, context, { rootValue }) => {
return postRepository.getBody(context.user, post);
}
}
}
});
사용 가능한 GraphQL 미들웨어
사용 가능한 Casbin GraphQL 통합:
| Middleware | GraphQL Implementation | Author | Description |
|---|---|---|---|
| graphql-authz | graphql | Casbin | graphql-go용 인증 미들웨어 |
| graphql-casbin | graphql | @esmaeilpour | GraphQL 및 Casbin 통합 예제 |
| gqlgen_casbin_RBAC_example | gqlgen | @WenyXu | (empty) |
| Middleware | GraphQL Implementation | Author | Description |
|---|---|---|---|
| graphql-authz | GraphQL.js | Casbin | GraphQL.js용 Casbin 인증 미들웨어 |
| Middleware | GraphQL Implementation | Author | Description |
|---|---|---|---|
| graphql-authz | GraphQL-core 3 | @Checho3388 | GraphQL-core 3용 Casbin 인증 미들웨어 |
Comments are powered by giscus and GitHub Discussions. They load from giscus.app and GitHub only after you click the button below.