본문으로 건너뛰기

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 통합:

MiddlewareGraphQL ImplementationAuthorDescription
graphql-authzgraphqlCasbingraphql-go용 인증 미들웨어
graphql-casbingraphql@esmaeilpourGraphQL 및 Casbin 통합 예제
gqlgen_casbin_RBAC_examplegqlgen@WenyXu(empty)

Comments are powered by giscus and GitHub Discussions. They load from giscus.app and GitHub only after you click the button below.